Changeset 5754


Ignore:
Timestamp:
Mar 14, 2018 8:28:52 AM (7 years ago)
Author:
nanang
Message:

Re #2059: Fixed assertion in JSON name verification due to NULL string pointer passed to string::compare() in reading array node.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/json.cpp

    r4761 r5754  
    311311     * elements to have name). 
    312312     */ 
    313     if (name.size() && name.compare(0, name.size(), 
    314                                     jdat->childPtr->name.ptr, 
    315                                     jdat->childPtr->name.slen) && 
    316         jdat->childPtr->name.slen && 
    317         jdat->jnode->type != PJ_JSON_VAL_ARRAY) 
     313    if (jdat->jnode->type != PJ_JSON_VAL_ARRAY && 
     314        name.size() && jdat->childPtr->name.slen && 
     315        name.compare(0, name.size(), jdat->childPtr->name.ptr, 
     316                                     jdat->childPtr->name.slen)) 
    318317    { 
    319318        char err_msg[80]; 
Note: See TracChangeset for help on using the changeset viewer.