gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-42


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-420-gc2d6449
Date: Sat, 08 Dec 2012 13:36:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  c2d64494d248e86fba41ec74310b94630510c7cd (commit)
      from  ea4ea9811ad12b741c5fef3d11d3300f4c8b5efa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=c2d64494d248e86fba41ec74310b94630510c7cd


commit c2d64494d248e86fba41ec74310b94630510c7cd
Author: Daniele Forsi <address@hidden>
Date:   Sat Dec 8 14:32:46 2012 +0100

    Avoid underflow in minutes2validity() when minutes < 5
    
    When minutes is less than 5, the result of minutes / 5 - 1 is -1
    or 255 when cast to unsigned char.

diff --git a/common/gsm-sms.c b/common/gsm-sms.c
index 1430ec4..b4240df 100644
--- a/common/gsm-sms.c
+++ b/common/gsm-sms.c
@@ -273,7 +273,9 @@ unsigned char *sms_timestamp_pack(gn_timestamp *dt, 
unsigned char *number)
 static unsigned char minutes2validity(unsigned int minutes)
 {
        /* Relative format can encode only some values! */
-       if (minutes <= (143 + 1) * 5)
+       if (minutes <= 4)
+               return 0;
+       else if (minutes <= (143 + 1) * 5)
                return minutes / 5 - 1;
        else if (minutes <= 12 * 60 + (167 - 143) * 30)
                return (minutes - 12 * 60) / 30 + 143;

-----------------------------------------------------------------------

Summary of changes:
 common/gsm-sms.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]