Merge pull request #331 from dragos-oancea/sofia-sdp_zone-cmp-val-never-read

[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:
Andrey Volk 2020-02-12 22:38:51 +04:00 committed by GitHub
commit 7e205a4a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1336,6 +1336,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++) {