pts: Use memchr(3) instead of strchr(3) to extract hash algorithm name
The string read with read(2) might not be null terminated.
This commit is contained in:
@@ -252,7 +252,7 @@ pts_ima_event_list_t* pts_ima_event_list_create(char *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* extract the hash algorithm name */
|
/* extract the hash algorithm name */
|
||||||
pos = strchr(algo_digest, '\0');
|
pos = memchr(algo_digest, '\0', algo_digest_len);
|
||||||
if (!pos)
|
if (!pos)
|
||||||
{
|
{
|
||||||
error = "no algo field";
|
error = "no algo field";
|
||||||
|
|||||||
Reference in New Issue
Block a user