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:
Tobias Brunner
2014-07-01 17:58:36 +02:00
parent f82d7aff85
commit 530d87be1b
+1 -1
View File
@@ -252,7 +252,7 @@ pts_ima_event_list_t* pts_ima_event_list_create(char *file)
}
/* extract the hash algorithm name */
pos = strchr(algo_digest, '\0');
pos = memchr(algo_digest, '\0', algo_digest_len);
if (!pos)
{
error = "no algo field";