Commit Diff
- Commit:
8991a328535f89f3f2257269f5c2d3fcec8bda69
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
- Message:
- add a missing bounds-check in got-fetch-pack when parsing server response The tokenize_refline() function could end up reading past the end of the buffer if the refline is not terminated with whitespace or \0.
- Actions:
- Patch | Tree
--- libexec/got-fetch-pack/got-fetch-pack.c +++ libexec/got-fetch-pack/got-fetch-pack.c @@ -294,7 +294,7 @@ tokenize_refline(char **tokens, char *line, int len, i n++; } p = line; - while (*line != '\0' && + while (*line != '\0' && n < len && (!isspace(*line) || i == maxtokens - 1)) { line++; n++;