texinfo-commits
[Top][All Lists]
Advanced

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

texinfo ChangeLog info/info-utils.c


From: Karl Berry
Subject: texinfo ChangeLog info/info-utils.c
Date: Sat, 14 Jul 2012 22:41:03 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Karl Berry <karl>       12/07/14 22:41:03

Modified files:
        .              : ChangeLog 
        info           : info-utils.c 

Log message:
        do not use ap after destruction

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/ChangeLog?cvsroot=texinfo&r1=1.1386&r2=1.1387
http://cvs.savannah.gnu.org/viewcvs/texinfo/info/info-utils.c?cvsroot=texinfo&r1=1.18&r2=1.19

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.1386
retrieving revision 1.1387
diff -u -b -r1.1386 -r1.1387
--- ChangeLog   13 Jul 2012 17:36:09 -0000      1.1386
+++ ChangeLog   14 Jul 2012 22:41:02 -0000      1.1387
@@ -1,3 +1,9 @@
+2012-07-14  Andreas Schwab  <address@hidden>
+
+       * info/info-utils.c (text_buffer_vprintf): Create a copy of `ap' in
+       the loop to avoid use after destruction.
+       Report from Patrice, 13 Jul 2012 23:31:10.
+
 2012-07-13  Karl Berry  <address@hidden>
 
        * doc/texinfo.txi (HTML Xref Command Expansion): Clarify/unify

Index: info/info-utils.c
===================================================================
RCS file: /sources/texinfo/texinfo/info/info-utils.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- info/info-utils.c   12 Apr 2012 10:38:28 -0000      1.18
+++ info/info-utils.c   14 Jul 2012 22:41:02 -0000      1.19
@@ -1,7 +1,7 @@
 /* info-utils.c -- miscellanous.
-   $Id: info-utils.c,v 1.18 2012/04/12 10:38:28 gray Exp $
+   $Id: info-utils.c,v 1.19 2012/07/14 22:41:02 karl Exp $
 
-   Copyright (C) 1993, 1998, 2003, 2004, 2007, 2008, 2009, 2011
+   Copyright (C) 1993, 1998, 2003, 2004, 2007, 2008, 2009, 2011, 2012
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -782,6 +782,7 @@
 text_buffer_vprintf (struct text_buffer *buf, const char *format, va_list ap)
 {
   ssize_t n;
+  va_list ap_copy;
   
   if (!buf->base)
     {
@@ -793,8 +794,10 @@
   
   for (;;)
     {
+      va_copy (ap_copy, ap);
       n = vsnprintf (buf->base + buf->off, buf->size - buf->off,
-                    format, ap);
+                    format, ap_copy);
+      va_end (ap_copy);
       if (n < 0 || buf->off + n >= buf->size ||
          !memchr (buf->base + buf->off, '\0', buf->size - buf->off + 1))
        {



reply via email to

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