You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code detection tool thinks that when if (pos != NULL) is false, that is, when pos is null, the strchr(pos, ',') operation will be performed on pos, causing a null pointer error, for example:
line 226: if (*pos != '\0') when pos is null.
line 236: pos = strchrnul(pos, ','); Dereference of a null pointer.
However, this will not happen, because the configuration condition(line 234) will be judged first. If pos is null, line 236 will not be executed.
SOLUTION:
Use strchrnul to replace strchr. Even if no characters are matched, a null pointer will not be returned, thus avoiding incorrect judgment by code detection tools.
Signed-off-by: wangzhi16 <[email protected]>
0 commit comments