Fixes to Coverity defects.

This commit is contained in:
Markus Makela
2015-03-10 17:08:04 +02:00
parent e937947f01
commit fbedad84af
7 changed files with 32 additions and 24 deletions

View File

@ -2138,7 +2138,7 @@ config_get_release_string(char* release)
*end = 0;
to = strcpy(distribution, "lsb: ");
memmove(to, found, end - found + 1);
memmove(to, found, end - found + 1 < INT_MAX ? end - found + 1 : INT_MAX);
strncpy(release, to, _RELEASE_STR_LENGTH);
@ -2175,7 +2175,7 @@ config_get_release_string(char* release)
+5 and -8 below cut the file name part out of the
full pathname that corresponds to the mask as above.
*/
new_to = strcpy(distribution, found.gl_pathv[0] + 5);
new_to = strncpy(distribution, found.gl_pathv[0] + 5,_RELEASE_STR_LENGTH - 1);
new_to += 8;
*new_to++ = ':';
*new_to++ = ' ';