Skip to content

Commit 8ee8b16

Browse files
committed
Check ptr to string before use it
Closes #51
1 parent def49fe commit 8ee8b16

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

http/lib.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ lbox_httpd_escape_html(struct lua_State *L)
114114
continue;
115115
}
116116
const char *s = lua_tostring(L, i);
117+
if (s == NULL) {
118+
continue;
119+
}
117120
for (; *s; s++) {
118121
switch(*s) {
119122
case '&':

0 commit comments

Comments
 (0)