Kaydet (Commit) 7f554464 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#982762 Dereference NULL

Change-Id: I9da66fe9cf279231d6024f23fbb273797b289ba7
üst 942c21a0
...@@ -919,7 +919,10 @@ bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) ...@@ -919,7 +919,10 @@ bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat)
return false; return false;
tmp = strrchr(prstatbuf, ')'); tmp = strrchr(prstatbuf, ')');
if(tmp)
{
*tmp = '\0'; *tmp = '\0';
memset(procstat->command, 0, sizeof(procstat->command)); memset(procstat->command, 0, sizeof(procstat->command));
sscanf(prstatbuf, "%d (%15c", &procstat->pid, procstat->command); sscanf(prstatbuf, "%d (%15c", &procstat->pid, procstat->command);
...@@ -944,6 +947,11 @@ bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) ...@@ -944,6 +947,11 @@ bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat)
&procstat->wchan, &procstat->nswap, &procstat->cnswap &procstat->wchan, &procstat->nswap, &procstat->cnswap
); );
} }
else
{
bRet = false;
}
}
return bRet; return bRet;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment