Make sure start pointer is legal in strtaglen()

strtaglen() takes care not go fall off the edge off the world... except
if you make it start there. Oops.
This commit is contained in:
Panu Matilainen 2016-11-17 11:27:59 +02:00
parent 6bada81529
commit 1b93f23579
1 changed files with 2 additions and 0 deletions

View File

@ -351,6 +351,8 @@ static inline int strtaglen(const char *str, rpm_count_t c, const char *end)
const char *s;
if (end) {
if (str >= end)
return -1;
while ((s = memchr(start, '\0', end-start))) {
if (--c == 0 || s > end)
break;