summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 9fda71eba4..ffa05a967b 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -5108,7 +5108,7 @@ state_2:
break;
case '"':
case '\'':
- if (*(p-1) != '\\') {
+ if (p >= buf + 1 && *(p-1) != '\\') {
if (lc == c) {
lc = '\0';
} else if (lc != '\\') {