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

coverity: 324943: confirm get_random worked

In normal systems this doesn't have a way to fail.  But check it for
consistency.
This commit is contained in:
Andy Green 2020-08-14 09:07:27 +01:00
parent aec2bdec2f
commit 491f0f6068

View file

@ -1016,7 +1016,10 @@ lws_http_multipart_headers(struct lws *wsi, uint8_t *p)
char buf[10], arg[48];
int n;
lws_get_random(wsi->a.context, (uint8_t *)buf, sizeof(buf));
if (lws_get_random(wsi->a.context, (uint8_t *)buf, sizeof(buf)) !=
sizeof(buf))
return NULL;
lws_b64_encode_string(buf, sizeof(buf),
wsi->http.multipart_boundary,
sizeof(wsi->http.multipart_boundary));