mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
CPP: Add a test that uses 'gets'.
This commit is contained in:
@@ -28,3 +28,14 @@ int is_morning() {
|
||||
struct tm *now = gmtime(time(NULL)); // BAD: gmtime uses shared state
|
||||
return (now->tm_hour < 12);
|
||||
}
|
||||
|
||||
char *gets(char *s);
|
||||
|
||||
void testGets() {
|
||||
char buf1[1024];
|
||||
char buf2 = malloc(1024);
|
||||
char *s;
|
||||
|
||||
gets(buf1); // BAD: use of gets
|
||||
s = gets(buf2); // BAD: use of gets
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user