Fix coverity scan warnings.

* Fix the leaking `fd`.
 * Fix the possible overflow of strcat().

Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
Gris Ge
2018-09-17 21:18:49 +08:00
committed by Iustin Pop
parent 0d1245dce0
commit 874d58d952
2 changed files with 13 additions and 12 deletions

View File

@@ -333,8 +333,7 @@ find_pars(FILE *dbf, char *company, char *product, char *rev, devdef_tr *defs, i
continue;
}
strcpy(modebuf, comptr);
strcat(modebuf, cp);
snprintf(defstr, sizeof(defstr)/sizeof(char), "%s%s", comptr, cp);
*nextdef = c;
if (verbose > 1)