kernel: fix not null terminated string in options()
CID 155471 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)67. buffer_size_warning: Calling strncpy with a maximum size argument of 256 bytes on destination array envcopy of size 256 bytes might leave the destination string unterminated.
This commit is contained in:
@@ -95,7 +95,7 @@ options(int argc, char* argv[])
|
|||||||
}else if(strcmp(next, "idlespin") == 0){
|
}else if(strcmp(next, "idlespin") == 0){
|
||||||
onIdleSpin();
|
onIdleSpin();
|
||||||
}else{
|
}else{
|
||||||
strncpy(envcopy, next, sizeof envcopy);
|
strncpy(envcopy, next, sizeof(envcopy)-1);
|
||||||
gettokens(envcopy, env, 2, "=");
|
gettokens(envcopy, env, 2, "=");
|
||||||
if(strcmp(env[0], "maxcores") == 0){
|
if(strcmp(env[0], "maxcores") == 0){
|
||||||
maxcores = strtol(env[1], 0, 0);
|
maxcores = strtol(env[1], 0, 0);
|
||||||
|
Reference in New Issue
Block a user