]> code.citadel.org Git - citadel.git/commitdiff
* Fixed a memory allocation bug in the vCard parser
authorArt Cancro <ajc@citadel.org>
Sat, 15 Jun 2002 20:14:55 +0000 (20:14 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 15 Jun 2002 20:14:55 +0000 (20:14 +0000)
citadel/ChangeLog
citadel/vcard.c

index 66d1033827acec50d73cb4913c76bcd69e9577d3..6dbdb92ff763eafedae303ff04bc3946d6054226 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.44  2002/06/15 20:14:55  ajc
+ * Fixed a memory allocation bug in the vCard parser
+
  Revision 591.43  2002/06/15 17:53:59  error
  * citserver.c: MESG command can now send a different system message based
    on the developer and client ID of the connected client
@@ -3729,3 +3732,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index e0825316c1c10775c28849367e985ad02ea80f7f..3906c4c22daf58490937c1ed6094f5163eb08f21 100644 (file)
@@ -91,7 +91,7 @@ struct vCard *vcard_load(char *vtext) {
                colonpos = pattern2(ptr, ":");
                nlpos = pattern2(ptr, "\n");
 
-               if (nlpos > colonpos > 0) {
+               if ((nlpos > colonpos) && (colonpos > 0)) {
                        namebuf = mallok(colonpos + 1);
                        valuebuf = mallok(nlpos - colonpos + 1);
                        strncpy(namebuf, ptr, colonpos);