Skip to content
Snippets Groups Projects
Commit b6584f1e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix NULL-ptr dereferences when subscan is NULL

parent 5d7228eb
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1097 passed
......@@ -287,16 +287,16 @@ static JSBool js_sub_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
*vp = JSVAL_FALSE;
break;
case SUB_PROP_SCAN_PTR:
*vp=UINT_TO_JSVAL(scan->ptr);
if(scan != NULL) *vp=UINT_TO_JSVAL(scan->ptr);
break;
case SUB_PROP_SCAN_CFG:
*vp=UINT_TO_JSVAL(scan->cfg);
if(scan != NULL) *vp=UINT_TO_JSVAL(scan->cfg);
break;
case SUB_PROP_LAST_READ:
*vp=UINT_TO_JSVAL(scan->last);
if(scan != NULL) *vp=UINT_TO_JSVAL(scan->last);
break;
case SUB_PROP_POSTS:
*vp=UINT_TO_JSVAL(getposts(p->cfg, p->subnum));
if(scan != NULL) *vp=UINT_TO_JSVAL(getposts(p->cfg, p->subnum));
break;
}
......@@ -543,7 +543,8 @@ JSBool DLLCALL js_msg_area_resolve(JSContext* cx, JSObject* areaobj, jsid id)
if(np == NULL)
continue;
*np = *p;
np->subscan = &p->subscan[d];
if(p->subscan != NULL)
np->subscan = &p->subscan[d];
np->subnum = d;
JS_SetPrivate(cx, subobj, np);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment