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


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-383-gfff1282
Date: Fri, 09 Mar 2012 10:07:21 +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  fff1282e5e96b32f66d57c35e74676b0563cb844 (commit)
      from  58e8e0866e8037b56725653265f24f2566f956aa (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=fff1282e5e96b32f66d57c35e74676b0563cb844


commit fff1282e5e96b32f66d57c35e74676b0563cb844
Author: Daniele Forsi <address@hidden>
Date:   Thu Mar 8 23:50:47 2012 +0100

    Have char_uni_alphabet_encode() convert 1 character at a time
    
    Otherwise it will try to convert up to the end of the string in
    one pass and overrun the temporary storage in wchar_t wch.
    Fixes:
     Program received signal SIGSEGV, Segmentation fault.
     0x08097833 in pnok_string_encode (dest=0x6f <Address 0x6f out of bounds>, 
max=10, src=0xbfffd968 "Mio numero") at 
../../../gnokii/common/phones/nokia.c:124
     124                        dest[i] = pnok_uni_to_nokia(wch);
     (gdb) bt
     #0  0x08097833 in pnok_string_encode (dest=0x6f <Address 0x6f out of 
bounds>, max=10, src=0xbfffd968 "Mio numero") at 
../../../gnokii/common/phones/nokia.c:124
     #1  0x00000072 in ?? ()
     #2  0x0000006f in ?? ()
     #3  0x0000000a in ?? ()
     #4  0xbfffd968 in ?? ()
     Backtrace stopped: previous frame inner to this frame (corrupt stack?)

diff --git a/common/phones/nokia.c b/common/phones/nokia.c
index 4d2ef4d..2688da5 100644
--- a/common/phones/nokia.c
+++ b/common/phones/nokia.c
@@ -120,7 +120,7 @@ size_t pnok_string_encode(unsigned char *dest, size_t max, 
const unsigned char *
 
        MBSTATE_ENC_CLEAR(mbs);
        for (i = 0, j = 0; i < max && src[j]; i++, j += n) {
-               n = char_uni_alphabet_encode(src + j, max - j, &wch, &mbs);
+               n = char_uni_alphabet_encode(src + j, 1, &wch, &mbs);
                dest[i] = pnok_uni_to_nokia(wch);
        }
        return i;

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

Summary of changes:
 common/phones/nokia.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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