]> git.deb.at Git - pkg/abook.git/blobdiff - ldif.c
remover a debug message
[pkg/abook.git] / ldif.c
diff --git a/ldif.c b/ldif.c
index 9a69f12632a9612a386ffba94621b369a4a2fec5..617cefceaca0ea6da9ae178dbfcb9d4578f10899 100644 (file)
--- a/ldif.c
+++ b/ldif.c
@@ -1,6 +1,6 @@
 
 /*
- * adapted to use with abook by JH <jheinonen@bigfoot.com>
+ * adapted to use with abook by JH <jheinonen@users.sourceforge.net>
  */
 
 /*
@@ -327,10 +327,16 @@ ldif_type_and_value( char *type, char *val, int vlen )
 {
     char       *buf, *p;
     int                tlen;
+    size_t     bufsize, t;
 
     tlen = strlen( type );
-    if (( buf = (char *)malloc( LDIF_SIZE_NEEDED( tlen, vlen ) + 1 )) !=
-           NULL ) {
+
+    t = LDIF_SIZE_NEEDED( tlen, vlen );
+    if((bufsize = t + 1) <= t)
+        return NULL;
+
+    if (( buf = (char *)malloc( bufsize )) == NULL ) {
+       return NULL;
     }
 
     p = buf;