Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbc8e78 commit a82832eCopy full SHA for a82832e
1 file changed
cpp/ql/test/query-tests/Security/CWE/CWE-676/semmle/PotentiallyDangerousFunction/test.c
@@ -28,3 +28,14 @@ int is_morning() {
28
struct tm *now = gmtime(time(NULL)); // BAD: gmtime uses shared state
29
return (now->tm_hour < 12);
30
}
31
+
32
+char *gets(char *s);
33
34
+void testGets() {
35
+ char buf1[1024];
36
+ char buf2 = malloc(1024);
37
+ char *s;
38
39
+ gets(buf1); // BAD: use of gets
40
+ s = gets(buf2); // BAD: use of gets
41
+}
0 commit comments