summaryrefslogtreecommitdiff
path: root/preproc.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-07-23 18:51:51 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-07-23 18:51:51 +0400
commit4e1d5ab0cff00aa6d7bc39c8bc871d6c9621c16f (patch)
tree2692f9aace7c78a2c65fba87e7438af0ae04ea9a /preproc.c
parent077fb93d2bfaf2d4acb356535026efe56c0e120e (diff)
downloadnasm-4e1d5ab0cff00aa6d7bc39c8bc871d6c9621c16f.tar.gz
preproc.: Fix NULL dereference on broken %strlen argument
Under particular circumstances %strlen may cause SIGSEG. A typical example is %strlen with nonexistent macro argument. [ Testcase test/strlen.asm ] Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'preproc.c')
-rw-r--r--preproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index 7fc3e74d..d75b58eb 100644
--- a/preproc.c
+++ b/preproc.c
@@ -3254,7 +3254,7 @@ issue_error:
while (tok_type_(t, TOK_WHITESPACE))
t = t->next;
/* t should now point to the string */
- if (t->type != TOK_STRING) {
+ if (!tok_type_(t, TOK_STRING)) {
error(ERR_NONFATAL,
"`%%strlen` requires string as second parameter");
free_tlist(tline);