From 022efe33888fae92cd5da24a3278f619b4197c06 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 20 Feb 2020 14:11:43 +0400 Subject: [PATCH] [sofia-sip] Guard `if` in sres_record_compare() and fix braces in sres_resolver_receive(). --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 4aee8f62bb..de80c1d74e 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed Feb 19 22:50:10 UTC 2020 +Thu Feb 20 10:09:05 UTC 2020 diff --git a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c index 07e3e322b4..d14ed309d3 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c +++ b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c @@ -1640,7 +1640,8 @@ sres_record_compare(sres_record_t const *aa, sres_record_t const *bb) D = A->a6_prelen - B->a6_prelen; if (D) return D; D = !A->a6_prename - !B->a6_prename; if (D == 0 && A->a6_prename && B->a6_prename) - D = su_strcasecmp(A->a6_prename, B->a6_prename); if (D) return D; + D = su_strcasecmp(A->a6_prename, B->a6_prename); + if (D) return D; return memcmp(&A->a6_suffix, &B->a6_suffix, sizeof A->a6_suffix); } case sres_type_aaaa: @@ -3460,7 +3461,7 @@ sres_resolver_receive(sres_resolver_t *res, int socket) sres_record_t **reply; sres_server_t *dns; - struct sockaddr_storage from[1] = { 0 }; + struct sockaddr_storage from[1] = {{0}}; socklen_t fromlen = sizeof from; SU_DEBUG_9(("%s(%p, %u) called\n", "sres_resolver_receive",