3 Commits
Author SHA1 Message Date
Ondřej SurýandMark Andrews c8c6718ee4 Add semantic patch to replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf
(cherry picked from commit ac26ecf540)
2019-10-04 14:08:25 +10:00
Ondřej SurýandMark Andrews 500b5b9f79 Add semantic patches to correctly check dns_name_copy(..., NULL) return code
The dns_name_copy() function cannot fail gracefully when the last argument
(target) is NULL.  Add RUNTIME_CHECK()s around such calls.

The first semantic patch adds RUNTIME_CHECK() around any call that ignores the
return value and is very safe to apply.

The second semantic patch attempts to properly add RUNTIME_CHECK() to places
where the return value from `dns_name_copy()` is recorded into `result`
variable.  The result of this semantic patch needs to be reviewed by hand.

Both patches misses couple places where the code surrounding the
`dns_name_copy(..., NULL)` usage is more complicated and is better suited to be
fixed by a human being that understands the surrounding code.

(cherry picked from commit 406eba0c41)
2019-10-04 14:08:25 +10:00
Ondřej SurýandOndřej Surý 21db43da8e Add unreachable.spatch coccinelle recipe and run it in precheck CI phase 2018-11-22 09:28:00 -05:00