Skip to content

Commit

Permalink
alloca() proper length buffer (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Shafer committed Jan 2, 2025
1 parent 8ea58f7 commit eb11ed8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libslax/slaxlexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ slaxLexer (slax_data_t *sdp)
int start = sdp->sd_start + COMMENT_MARKER_SIZE;
int end = sdp->sd_cur - COMMENT_MARKER_SIZE;
int len = end - start;
xmlChar *buf = alloca(len + 1), *contents;
xmlChar *buf = alloca(len + 3), *contents;
xmlNodePtr nodep;

while (isspace((int) sdp->sd_buf[start])) {
Expand Down

0 comments on commit eb11ed8

Please sign in to comment.