OSSP CVS Repository

ossp - Check-in [5274]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5274
Date: 2005-Oct-12 10:24:30 (local)
2005-Oct-12 08:24:30 (UTC)
User:rse
Branch:
Comment: Fixed str_parse(3): the va_list argument was incorrectly used twice for processing the arguments and hence lead to a segmentation faults. It is triggered by calls like str_parse(var, "s/^(.+?):(.+)$/$1-%s-$2/", &new, subst);

Submitted by: Vasil Dimov <vd@datamax.bg>

Tickets:
#69 str_parse() uses the same va_list ap twice causing segfault
Inspections:
Files:
ossp-pkg/str/ChangeLog      1.55 -> 1.56     8 inserted, 0 deleted
ossp-pkg/str/THANKS      1.10 -> 1.11     2 inserted, 1 deleted
ossp-pkg/str/str_parse.c      1.21 -> 1.22     3 inserted, 1 deleted

ossp-pkg/str/ChangeLog 1.55 -> 1.56

--- ChangeLog    2005/10/03 07:40:05     1.55
+++ ChangeLog    2005/10/12 08:24:30     1.56
@@ -9,6 +9,14 @@
 
  ChangeLog
 
+ Changes between 0.9.11 and 0.9.12 (03-Oct-2005 to 12-Oct-2005):
+
+   *) Fixed str_parse(3): the va_list argument was incorrectly used
+      twice for processing the arguments and hence lead to a
+      segmentation faults. It is triggered by calls like
+      str_parse(var, "s/^(.+?):(.+)$/$1-%s-$2/", &new, subst);
+      [Vasil Dimov <vd@datamax.bg>]
+
  Changes between 0.9.10 and 0.9.11 (24-Jan-2004 to 03-Oct-2005):
 
    *) Security Fix to str_pcre.c (CAN-2005-2491, partially only)


ossp-pkg/str/THANKS 1.10 -> 1.11

--- THANKS       2003/02/11 08:39:47     1.10
+++ THANKS       2005/10/12 08:24:30     1.11
@@ -12,6 +12,7 @@
   Credit has to be given to the following people who contributed ideas,
   stuff, bugfixes, hints etc. (in alphabetical order):
 
+  o Vasil Dimov              <vd@datamax.bg>
   o Brian T. Egleston        <brian@egleston.com>
   o Dean Gaudet              <dgaudet@arctic.org>
   o Ed Griffiths             <edgrif@sanger.ac.uk>
@@ -23,5 +24,5 @@
   o Peter Simons             <simons@cryp.to>
   o Fritz Zaucker            <zaucker@ee.ethz.ch>
 
-  ...and all other Str users who gave me feedback but I've forgot...
+  ...and all other OSSP str users who gave me feedback but I've forgot...
 


ossp-pkg/str/str_parse.c 1.21 -> 1.22

--- str_parse.c  2005/01/24 15:22:19     1.21
+++ str_parse.c  2005/10/12 08:24:30     1.22
@@ -297,6 +297,7 @@
     char buf2[128];
     char *buf_ptr;
     str_vformat_t sf;
+    va_list ap_temp;
 
     /*
      * Caching support
@@ -564,7 +565,8 @@
         sf.data[3].p = (char *)string;
         sf.data[4].p = cap_vec;
         sf.data[5].i = cap_num;
-        l = str_vformat(&sf, buf_ptr, ap);
+        va_copy(ap_temp, ap);
+        l = str_vformat(&sf, buf_ptr, ap_temp);
 
         /* allocate output buffer */
         if ((*cpp = (char *)malloc(l+1)) == NULL) {

CVSTrac 2.0.1