Fix off-by-one errors

This commit is contained in:
2024-02-11 19:07:10 -06:00
parent 817271a1bb
commit 4f512c6503

View File

@@ -176,6 +176,8 @@ autoescapeend:
in_escape = 0;
++i;
/* read nest data into a string */
while (i < data->len) {
int c;
@@ -207,6 +209,7 @@ autoescapeend:
fputs("Unexpected EOF in nest\n", stderr);
return 1;
got_nest:
--i;
if ((tmp = stringfile()) == NULL) {
goto bufferror;
}
@@ -226,7 +229,7 @@ got_nest:
}
tmp->free(tmp);
return 0;
break;
bufferror:
fputs("Failed to create temporary buffer while nesting\n", stderr);
return 1;