diff options
author | Philip Guenther <guenther@openbsd.org> | 2013-10-18 15:38:55 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-10-18 15:38:55 +0100 |
commit | a7ed8fa56423636ca5e455bcd62684a54672da57 (patch) | |
tree | 1c8e29554f6a941c3f814ac04ce65bc3c85c3774 /x2p | |
parent | 099bebb16fa63575ffc552487c463aac86763c70 (diff) | |
download | perl-a7ed8fa56423636ca5e455bcd62684a54672da57.tar.gz |
fix off-by one error in a2p
The str_gets() function, when encountering a newline character, checked to
see if the previous char was a \ escape. For a blank line, the check would
read the char at the position one before the start of the buffer. There
was a test to avoid this, but it was off-by-one.
Diffstat (limited to 'x2p')
-rw-r--r-- | x2p/str.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -200,7 +200,7 @@ str_gets(STR *str, FILE *fp) for (;;) { while (--cnt >= 0) { if ((*bp++ = *ptr++) == newline) { - if (bp <= str->str_ptr || bp[-2] != '\\') + if (bp <= str->str_ptr + 1 || bp[-2] != '\\') goto thats_all_folks; else { line++; |