make everything use smatch_function_hashtable.h
[smatch.git] / validation / sm_array_overflow.c
blobc312a35ae0228fed890d0e753ba468e64c8fa904
1 int __spin_trylock(int x);
2 int frob();
3 int i;
4 static int options_write(void)
6 char buf[10];
7 int lock;
9 while(!__spin_trylock(lock))
10 frob();
11 __spin_unlock(lock);
13 for (i = 0; i < 10 && frob(); i++)
15 buf[i] = '\0';
18 * check-name: smatch array check
19 * check-command: smatch sm_array_overflow.c
21 * check-output-start
22 sm_array_overflow.c +15 options_write(11) error: buffer overflow 'buf' 10 <= 10
23 * check-output-end