[sofia-sip] scan-build: Access to field 'z_number_of_adjustments' results in a dereference of a null pointer (loaded from variable 'a')

This commit is contained in:
Dragos Oancea 2020-02-12 01:29:25 +00:00
parent 1b66e76548
commit d8cddaf4e9
1 changed files with 2 additions and 0 deletions

View File

@ -1334,6 +1334,8 @@ int sdp_zone_cmp(sdp_zone_t const *a, sdp_zone_t const *b)
if ((a != NULL) != (b != NULL))
return (a != NULL) < (b != NULL) ? -1 : 1;
if (!a || !b)
return -1;
n = a->z_number_of_adjustments < b->z_number_of_adjustments
? a->z_number_of_adjustments : b->z_number_of_adjustments;
for (i = 0; i < n; i++) {