bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clang's Undefined Sanitizer


From: Bruno Haible
Subject: Re: clang's Undefined Sanitizer
Date: Tue, 22 Aug 2017 18:49:26 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-91-generic; KDE/5.18.0; x86_64; ; )

[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

[Prev in Thread] Current Thread [Next in Thread]