Fix potential write out of bounds.

This commit is contained in:
Jordan Bancino 2023-05-26 23:47:36 +00:00
parent 42526c95bb
commit 54924b9444

View file

@ -657,7 +657,7 @@ HeaderParse(Stream * stream, HeaderExpr * expr)
/* Cope with preprocessor macro expansions at the top
* level. */
expr->type = HP_UNKNOWN;
strncpy(expr->data.text, word, HEADER_EXPR_MAX);
strncpy(expr->data.text, word, HEADER_EXPR_MAX - 1);
}
Free(word);