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>
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);
--- /dev/null
+%macro strlen_test 1
+ %strlen len %2 ; not existing argument
+%endmacro
+
+strlen_test 'a'