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

mqtt: handle NULL mqtt publish metadata

This commit is contained in:
Andy Green 2021-07-08 10:11:09 +01:00
parent 04761c4b7c
commit c042ba8c65

View file

@ -488,6 +488,10 @@ secstream_connect_munge_mqtt(lws_ss_handle_t *h, char *buf, size_t len,
for (n = 0; n < (int)LWS_ARRAY_SIZE(sources); n++) {
lws_strexp_init(&exp, (void *)h, lws_ss_exp_cb_metadata,
(char *)p, (size_t)-1);
if (!sources[n]) {
ps[n] = NULL;
continue;
}
ps[n] = (char *)p;
if (lws_strexp_expand(&exp, sources[n], strlen(sources[n]),
&used_in, &olen[n]) != LSTRX_DONE)