Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
    npro  
 Modern all-safe Rust Network Protocol library supporting h1, h2, h3, ws, wt sans-IO and with socket IO + tls
git clone https://npro.rs/repo/npro
 
root / assets / netbsd-OSX-bigsur.svg
Author[]Andy Green <andy@warmcat.com> 2026-04-19 20:10 UTC
Committer[]Andy Green <andy@warmcat.com> 2026-04-19 20:10 UTC
Tree328b2df7b155195c21bd3bb3622faaee54b89fc5   Raw Patch
 
CID 503236: FORWARD_NULL
CID 503236: FORWARD_NULL
diff --git a/src/server/s-ws-builder.c b/src/server/s-ws-builder.c index c7227cb..5e5e225 100644 --- a/src/server/s-ws-builder.c +++ b/src/server/s-ws-builder.c @@ -840,29 +840,30 @@ sais_ws_json_rx_builder(struct vhd *vhd, struct pss *pss, uint8_t *buf, size_t b lwsl_err("%s: no live for %s\n", __func__, build->name); live_sp = malloc(sizeof(*live_sp) + nlen + plen); - if (live_sp) { - char *p_str = (char *)(live_sp + 1); - - memset(live_sp, 0, sizeof(*live_sp)); - live_sp->name = p_str; - memcpy(p_str, build->name, nlen); - live_sp->platform = p_str + nlen; - memcpy(p_str + nlen, build->platform, plen); - lws_strncpy(live_sp->sai_hash, build->sai_hash, - sizeof(live_sp->sai_hash)); - lws_strncpy(live_sp->lws_hash, build->lws_hash, - sizeof(live_sp->lws_hash)); - live_sp->windows = build->windows; - live_sp->avail_mem_kib = (unsigned int)-1; - live_sp->avail_sto_kib = (unsigned int)-1; - live_sp->wsi = pss->wsi; - live_sp->cx = lws_get_context(pss->wsi); - live_sp->vhd = vhd; - live_sp->online = 1; - lws_strncpy(live_sp->peer_ip, pss->peer_ip, sizeof(live_sp->peer_ip)); - - lws_dll2_add_tail(&live_sp->sai_plat_list, &vhd->server.builder_owner); - } + if (!live_sp) + continue; + + char *p_str = (char *)(live_sp + 1); + + memset(live_sp, 0, sizeof(*live_sp)); + live_sp->name = p_str; + memcpy(p_str, build->name, nlen); + live_sp->platform = p_str + nlen; + memcpy(p_str + nlen, build->platform, plen); + lws_strncpy(live_sp->sai_hash, build->sai_hash, + sizeof(live_sp->sai_hash)); + lws_strncpy(live_sp->lws_hash, build->lws_hash, + sizeof(live_sp->lws_hash)); + live_sp->windows = build->windows; + live_sp->avail_mem_kib = (unsigned int)-1; + live_sp->avail_sto_kib = (unsigned int)-1; + live_sp->wsi = pss->wsi; + live_sp->cx = lws_get_context(pss->wsi); + live_sp->vhd = vhd; + live_sp->online = 1; + lws_strncpy(live_sp->peer_ip, pss->peer_ip, sizeof(live_sp->peer_ip)); + + lws_dll2_add_tail(&live_sp->sai_plat_list, &vhd->server.builder_owner); } lws_sul_schedule(live_sp->cx, 0, &live_sp->sul_find_jobs,
Page fetched 0s ago, creation time: 3ms (vhost etag hits: 0%, cache hits: 0%)