• George Nash's avatar
    String to endpoint fix parse error if uri is NULL · 9d101d12
    George Nash authored
    The start of the uri path must still be calculated even if uri is
    NULL (i.e. user is not interested in parsing the path component of
    the endpoint). This must be calculated since this value is used
    in later calculations for finding the port number.
    
    See lines 421-425 the `u` variable must be calculated for the code
    to properly calculate `p`. Variable `p` must be accurate or the
    address_len will be incorrect resulting in an incorrect string
    being sent for DNS lookup. Resulting in an error even for valid
    endpoint strings.
    
    With out this fix:
    `coap://openconnectivity.org/alpha` and
    `coaps+tcp://10.211.55.3/a/light` would both return errors
    when the uri param was NULL.
    
    With this fix those endpoint strings are properly parsed.
    Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
    9d101d12
eptest.cpp 6.02 KB