All of lore.kernel.org
 help / color / mirror / Atom feed
* Odd smatch issue?
@ 2019-01-11 12:32 John Levon
  2019-01-14 10:18 ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: John Levon @ 2019-01-11 12:32 UTC (permalink / raw)
  To: smatch



static long
lx_cap_update_priv(void)
{
        const int lx_cap_mapping[4] = { 0, 0, 0 };
        int i = 63;
        /* enabling the below line disables the warning */
        //int cap_set = i == 0;
        lx_cap_mapping[i];
}


/home/gk/src/smatch/smatch: a.c:8 lx_cap_update_priv() error: buffer overflow 'lx_cap_mapping' 4 <= 63

Distilled down from some real code, obviously, but it seems odd that
just *looking* at "i" means smatch can't figure out its max value?

thanks
john

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-14 14:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 12:32 Odd smatch issue? John Levon
2019-01-14 10:18 ` Dan Carpenter
2019-01-14 12:42   ` John Levon
2019-01-14 14:38     ` Dan Carpenter
2019-01-14 14:47       ` John Levon
2019-01-14 14:51         ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.