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:
parent
41a9489dd4
commit
20f15cbe5a
|
@ -95,7 +95,7 @@ options(int argc, char* argv[])
|
|||
}else if(strcmp(next, "idlespin") == 0){
|
||||
onIdleSpin();
|
||||
}else{
|
||||
strncpy(envcopy, next, sizeof envcopy);
|
||||
strncpy(envcopy, next, sizeof(envcopy)-1);
|
||||
gettokens(envcopy, env, 2, "=");
|
||||
if(strcmp(env[0], "maxcores") == 0){
|
||||
maxcores = strtol(env[1], 0, 0);
|
||||
|
|
Loading…
Reference in New Issue