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-48


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-480-g0a20998
Date: Sat, 20 Apr 2013 18:33:58 +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  0a2099811ed5127e127281a6612d32a5f34ffba2 (commit)
      from  a38fc8701808c7459b29e18903f05e50abd36683 (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=0a2099811ed5127e127281a6612d32a5f34ffba2


commit 0a2099811ed5127e127281a6612d32a5f34ffba2
Author: Daniele Forsi <address@hidden>
Date:   Sat Apr 20 19:29:59 2013 +0200

    Avoid buffer overrun for the main phone number
    
    Use the correct size for the main phone number which has less space than
    subentries.
    This went unnoticed because in the test vcard the tail of the long
    TEL;TYPE=PREF,VOICE number was overwritten by values coming later in the
    file and a zero byte in those values was likely to provide a string 
terminator.

diff --git a/common/vcard.c b/common/vcard.c
index 4998e2e..54e1923 100644
--- a/common/vcard.c
+++ b/common/vcard.c
@@ -292,6 +292,7 @@ GNOKII_API int gn_phonebook2vcard(FILE *f, 
gn_phonebook_entry *entry, char *loca
 #define STORE(a, b) STORE2(a, b, (void) 0)
 #define STOREINT(a, b) if (BEGINS(a)) { b = atoi(buf+strlen(a)); continue; }
 
+#define STORENUM(a, b) if (BEGINS(a)) { strip_slashes(b, buf + strlen(a), 
line_len - strlen(a), GN_PHONEBOOK_NUMBER_MAX_LENGTH); }
 #define STORESUB(a, c) if (entry->subentries_count == 
GN_PHONEBOOK_SUBENTRIES_MAX_NUMBER) return -1; \
                                STORE2(a, 
entry->subentries[entry->subentries_count++].data.number, \
                                
entry->subentries[entry->subentries_count].entry_type = c);
@@ -445,7 +446,7 @@ GNOKII_API int gn_vcardstr2phonebook(const char *vcard, 
gn_phonebook_entry *entr
                        continue;
                }
                STORE("FN:", entry->name);
-               STORE("TEL;TYPE=PREF,VOICE:", entry->number);
+               STORENUM("TEL;TYPE=PREF,VOICE:", entry->number);
 
                if (BEGINS("ADR;TYPE=HOME,PREF:")) {
                        if (0 < copy_fields(buf + 19, 7, 
GN_PHONEBOOK_ADDRESS_MAX_LENGTH,
diff --git a/testsuite/vcard/vcard-full-ascii.vcf 
b/testsuite/vcard/vcard-full-ascii.vcf
index 4abf100..e64293a 100644
--- a/testsuite/vcard/vcard-full-ascii.vcf
+++ b/testsuite/vcard/vcard-full-ascii.vcf
@@ -6,7 +6,7 @@ N:Family name 
1234567890123456789012345678901234567890123456789;Given name
  89012345678901234567890123456789012345;Honorific prefix 123456789012345678
  90123456789012345678901234;Honorific suffix 123456789012345678901234567890
  12345678901234
-TEL;TYPE=PREF,VOICE:12345678901234567890123456789012345678901234567890
+TEL;TYPE=PREF,VOICE:1234567890123456789012345678901234567890123456789
 X-GSM-MEMORY:ME
 X-GSM-LOCATION:1000
 X-GSM-CALLERGROUP:5

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

Summary of changes:
 common/vcard.c                       |    3 ++-
 testsuite/vcard/vcard-full-ascii.vcf |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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