gnokii-users
[Top][All Lists]
Advanced

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

[PATCH] fix crash in Samsung response processing when #last_name is #NUL


From: Danny Milosavljevic
Subject: [PATCH] fix crash in Samsung response processing when #last_name is #NULL
Date: Tue, 8 Jan 2008 14:37:39 +0000 (UTC)
User-agent: pan 0.119 (Karma Hunters)

Hi,

this fixes a crash in the Samsung response processing when last_name is
NULL:

 atsam.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff -upr o/gnokii-0.6.22/common/phones/atsam.c
gnokii-0.6.22/common/phones/atsam.c ---
o/gnokii-0.6.22/common/phones/atsam.c   2007-11-24 12:31:01.000000000 +0100
+++ gnokii-0.6.22/common/phones/atsam.c 2008-01-08 12:15:34.000000000
+0100 @@ -177,10 +177,13 @@ static gn_error ReplyReadPhonebook(int m
                                if (last_name)
                                        strncat(entry->name, " ", strlen(" "));
                        }
-                       if (strlen(last_name) + strlen(entry->name) + 1 > 
sizeof(entry->name))
-                               return GN_ERR_FAILED;
-                       if (last_name)
+                       if (last_name != NULL) {
+                               if (strlen(last_name) + strlen(entry->name) + 1 
>
sizeof(entry->name)) +                                  return GN_ERR_FAILED;
+
                                strncat(entry->name, last_name, strlen 
(last_name));
+                       }
+
                        free(tmp);
                }
        }
Nur in gnokii-0.6.22/common/phones: atsam.lo.





reply via email to

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