[misc] fix some Coverity warnings

This commit is contained in:
Pete Batard 2021-08-02 13:22:49 +01:00
parent 436584fcc0
commit 8538ce0590
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
7 changed files with 14 additions and 9 deletions

View file

@ -283,6 +283,7 @@ BOOL get_supported_locales(const char* filename)
if ((line[i] != 'l') && (line[i] != 'v') && (line[i] != 'a'))
continue;
// line[i] is not NUL so i+1 is safe to access
// coverity[tainted_data]
lcmd = get_loc_cmd(line[i], &line[i+1]);
if ((lcmd == NULL) || ((lcmd->command != LC_LOCALE) && (lcmd->command != LC_VERSION) && (lcmd->command != LC_ATTRIBUTES))) {
free_loc_cmd(lcmd);
@ -446,6 +447,7 @@ BOOL get_loc_data_file(const char* filename, loc_cmd* lcmd)
buf[i] = 0;
if (!eol)
loc_line_nr += line_nr_incr;
// coverity[tainted_data]
get_loc_data_line(buf);
break;
case '\r':