[sr-dev] git:master:94b4c256: modules/ims_qos modules/ims_registrar_scscf: fix comparison of unsigned expression

Jason Penton jason.penton at smilecoms.com
Mon Jun 6 11:25:26 CEST 2016


Hey Mikko,

This changes the 'semantics' of the code and is a bug. Could I suggest
rather using 0U to silence your compiler... ;)

Cheers
Jason

On Fri, Jun 3, 2016 at 9:25 AM, Mikko Lehto <mslehto at iki.fi> wrote:

> Module: kamailio
> Branch: master
> Commit: 94b4c25640c0f486c578a9e0670dad0aa5dda0c1
> URL:
> https://github.com/kamailio/kamailio/commit/94b4c25640c0f486c578a9e0670dad0aa5dda0c1
>
> Author: Mikko Lehto <mslehto at iki.fi>
> Committer: Mikko Lehto <mslehto at iki.fi>
> Date: 2016-05-25T13:49:21+03:00
>
> modules/ims_qos modules/ims_registrar_scscf: fix comparison of unsigned
> expression
>
> ---
>
> Modified: modules/ims_qos/rx_avp.c
> Modified: modules/ims_registrar_scscf/save.c
>
> ---
>
> Diff:
> https://github.com/kamailio/kamailio/commit/94b4c25640c0f486c578a9e0670dad0aa5dda0c1.diff
> Patch:
> https://github.com/kamailio/kamailio/commit/94b4c25640c0f486c578a9e0670dad0aa5dda0c1.patch
>
> ---
>
> diff --git a/modules/ims_qos/rx_avp.c b/modules/ims_qos/rx_avp.c
> index 657716c..124855c 100644
> --- a/modules/ims_qos/rx_avp.c
> +++ b/modules/ims_qos/rx_avp.c
> @@ -489,7 +489,7 @@ inline int
> rx_add_media_component_description_avp(AAAMessage *msg, int number, s
>         // Get A=RS-bandwidth from SDP-Reply:
>          bandwidth = sdp_b_value(rpl_raw_payload, "RS");
>          LM_DBG("Answer: Got bandwidth %i from b=RS-Line\n", bandwidth);
> -       if (bandwidth >= 0) {
> +       if (bandwidth > 0) {
>                 // Add AVP
>                 set_4bytes(x,bandwidth);
>                 rs_bw = cdpb.AAACreateAVP(AVP_EPC_RS_Bandwidth,
> @@ -501,7 +501,7 @@ inline int
> rx_add_media_component_description_avp(AAAMessage *msg, int number, s
>         // Get A=RS-bandwidth from SDP-Reply:
>          bandwidth = sdp_b_value(rpl_raw_payload, "RR");
>          LM_DBG("Answer: Got bandwidth %i from b=RR-Line\n", bandwidth);
> -       if (bandwidth >= 0) {
> +       if (bandwidth > 0) {
>                 // Add AVP
>                 set_4bytes(x,bandwidth);
>                 rr_bw = cdpb.AAACreateAVP(AVP_EPC_RR_Bandwidth,
> diff --git a/modules/ims_registrar_scscf/save.c
> b/modules/ims_registrar_scscf/save.c
> index 501eaa7..47dcf80 100644
> --- a/modules/ims_registrar_scscf/save.c
> +++ b/modules/ims_registrar_scscf/save.c
> @@ -111,7 +111,7 @@ static inline int randomize_expires(int expires, int
> range) {
>  static inline int calc_contact_expires(contact_t *c, unsigned int
> expires_hdr, int sos_reg) {
>      unsigned int r;
>
> -    if (expires_hdr >= 0)
> +    if (expires_hdr > 0)
>          r = expires_hdr;
>      else {
>          r = (sos_reg > 0) ? default_registrar_cfg.em_default_expires :
> default_registrar_cfg.default_expires;
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>



-- 

*Jason Penton*
*Senior Manager: Applications and Services*
*Smile Communications Pty (Ltd)*


*Voice:Mobile:* +234 (0) 702 000 000 7

+27 (0) 83 283 7000
*Skype:* jason.barry.penton
jason.penton at smilecoms.com <name.surname at smilecoms.com>
www.smilecoms.com

-- 


This email is subject to the disclaimer of Smile Communications at http://www.smilecoms.com/home/email-disclaimer/ <http://www.smilecoms.com/disclaimer>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160606/0bdc1bcc/attachment.html>


More information about the sr-dev mailing list