Fixes to Coverity defects.
This commit is contained in:
@ -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++ = ' ';
|
||||
|
||||
Reference in New Issue
Block a user