False positive fix (#2593)

* only report cert-STR07-C for C11

* fix false positive for checking c89/c99 code with cert-STR07-C
This commit is contained in:
fuzzelhjb 2020-04-07 07:29:49 +02:00 committed by GitHub
parent 3773d0e875
commit 9267182d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -317,6 +317,8 @@ def str05(data):
# STR07-C # STR07-C
# Use the bounds-checking interfaces for string manipulation # Use the bounds-checking interfaces for string manipulation
def str07(data): def str07(data):
if(data.standards.c=='c89' or data.standards.c=='c99'):
return
for token in data.tokenlist: for token in data.tokenlist:
if not isFunctionCall(token, ('strcpy', 'strcat')): if not isFunctionCall(token, ('strcpy', 'strcat')):
continue continue