summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2014-11-23 18:26:54 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2014-11-23 18:26:54 +0300
commita45febd767642dafc017a3210f357c7a2139e475 (patch)
tree9dff28fb31b5927108307a7ec1c093238fbb3b07
parent5c0b082c9289d78577168ad7eaf13b56c58deb5c (diff)
downloadnasm-a45febd767642dafc017a3210f357c7a2139e475.tar.gz
quote: Fix returning out of string pointer
In case if string is a single grave accent we return the pointer to uninitialized space. http://bugzilla.nasm.us/show_bug.cgi?id=3392292 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--quote.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/quote.c b/quote.c
index fe1c97d9..b1e9dbae 100644
--- a/quote.c
+++ b/quote.c
@@ -441,8 +441,10 @@ char *nasm_skip_string(char *str)
return p;
} else if (bq == '`') {
/* `...` string */
- p = str+1;
state = st_start;
+ p = str+1;
+ if (!*p)
+ return p;
while ((c = *p++)) {
switch (state) {