mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 16:55:10 +00:00
[FIX] Make Parsee not crash on some NULL strings
If only strlen had NULL-checking...
This commit is contained in:
parent
628a55fbca
commit
9101cf8409
1 changed files with 2 additions and 1 deletions
|
|
@ -155,7 +155,8 @@ XMPPifyElement(HashMap *event, XMLElement *elem, XMPPFlags flags)
|
||||||
#define Concat(strp) do \
|
#define Concat(strp) do \
|
||||||
{ \
|
{ \
|
||||||
size_t cidx; \
|
size_t cidx; \
|
||||||
for (cidx = 0; cidx < strlen(strp); cidx++) \
|
size_t len = strp ? strlen(strp) : 0; \
|
||||||
|
for (cidx = 0; cidx < len; cidx++) \
|
||||||
{ \
|
{ \
|
||||||
char cch[2] = { strp[cidx], 0 }; \
|
char cch[2] = { strp[cidx], 0 }; \
|
||||||
char nch = *cch ? strp[cidx+1] : '\0'; \
|
char nch = *cch ? strp[cidx+1] : '\0'; \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue