1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lws_struct: handle empty char array serialization

This commit is contained in:
Andy Green 2020-04-05 12:06:31 +01:00
parent fb3fd499e3
commit 370ba6f5ed

View file

@ -478,6 +478,10 @@ lws_struct_json_serialize(lws_struct_serialize_t *js, uint8_t *buf,
/* early check if the entry should be elided */
switch (map->type) {
case LSMT_STRING_CHAR_ARRAY:
if (!q)
goto up;
break;
case LSMT_STRING_PTR:
case LSMT_CHILD_PTR:
q = (char *)*(char **)q;