[Changing the subject, as this is an unrelated topic.]

Hi Tim,

> I also see several false positives from clang's Undefined Sanitizer due to
> alloca 'magic' (reallocations on stack space ?). This might not be directly
> related, but I think there is a common coding pattern.
> 
> glob.c:1738:23: runtime error: index 64 out of bounds for type 'char *[64]'
>     #0 0x557545 in glob_in_dir /home/tim/src/wget2/lib/glob.c:1738:40
>     #1 0x54ded1 in rpl_glob /home/tim/src/wget2/lib/glob.c:1306:16
> 
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior glob.c:1738:23 in
> glob.c:1739:27: runtime error: index 64 out of bounds for type 'char *[64]'
>     #0 0x5575d4 in glob_in_dir /home/tim/src/wget2/lib/glob.c:1739:27
>     #1 0x54ded1 in rpl_glob /home/tim/src/wget2/lib/glob.c:1306:16
> 
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior glob.c:1739:27 in
> glob.c:1811:21: runtime error: index 64 out of bounds for type 'char *[64]'
>     #0 0x55845e in glob_in_dir /home/tim/src/wget2/lib/glob.c:1811:21
>     #1 0x54ded1 in rpl_glob /home/tim/src/wget2/lib/glob.c:1306:16

It obviously does not handle the 'struct globnames' allocated with
the FLEXSIZEOF macro (lines 1719..1732).

Bruno


Reply via email to