diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-06 17:29:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-07 14:29:55 +0100 |
commit | 3d9d0b78a709065b49651e1635b8f6fe5daa2d17 (patch) | |
tree | 2f42c3b826519a034d432e8040d71b49f78d0ab7 /codemaker | |
parent | fb6d3b883bfcd8de73d4426cc68ed6a7cc9e773a (diff) |
coverity#1242375 Don't call fscanf without specifiers
Change-Id: I58082770ca79da9c4d235b5ea0dc79c688c7498b
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/cppumaker/cppuoptions.cxx | 2 | ||||
-rw-r--r-- | codemaker/source/javamaker/javaoptions.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx index 3436a176b3ef..3414a533ee53 100644 --- a/codemaker/source/cppumaker/cppuoptions.cxx +++ b/codemaker/source/cppumaker/cppuoptions.cxx @@ -276,7 +276,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) char* rargv[512]; char buffer[512]; - while ( fscanf(cmdFile, "%s", buffer) != EOF ) + while (fscanf(cmdFile, "%511s", buffer) != EOF && rargc < 512) { rargv[rargc]= strdup(buffer); rargc++; diff --git a/codemaker/source/javamaker/javaoptions.cxx b/codemaker/source/javamaker/javaoptions.cxx index e1f25247c725..75e2bd65153a 100644 --- a/codemaker/source/javamaker/javaoptions.cxx +++ b/codemaker/source/javamaker/javaoptions.cxx @@ -200,7 +200,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) char* rargv[512]; char buffer[512]; - while ( fscanf(cmdFile, "%s", buffer) != EOF ) + while (fscanf(cmdFile, "%511s", buffer) != EOF && rargc < 512) { rargv[rargc]= strdup(buffer); rargc++; |