]> git.ozlabs.org Git - ccan/commitdiff
ccanlint: avoid segfault when module_builds' linking fails
authorPeter Barker <pb-ccan@barker.dropbear.id.au>
Fri, 10 Apr 2015 01:26:23 +0000 (11:26 +1000)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 10 Apr 2015 03:03:46 +0000 (12:33 +0930)
In the case that the objects built but linking failed, module_builds.c
called score_file_error with a NULL ccan_file object and 0 for line
number.

score_file_error assumed that the ccan_file object it is passed was
not-NULL when appending file errors to the score's aggregate error
string.  It attempted to dereference it to get "fullname".

score_error was factored out from score_file_error.  It takes a
"source" parameter, which is the file's full name (and possibly line
number) in the score_file_error case, and the ccan module name in the
case of link failure.


No differences found