Source-Changes-HG archive

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

[src/trunk]: src/gnu/dist/texinfo Some sanity fixes (including a possible buf...



details:   https://anonhg.NetBSD.org/src/rev/b2335d183c1b
branches:  trunk
changeset: 520789:b2335d183c1b
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Jan 16 17:22:37 2002 +0000

description:
Some sanity fixes (including a possible buffer overflow in makeinfo), plus
some fixed proper support for Cygwin hosts.

diffstat:

 gnu/dist/texinfo/info/nodes.c     |   3 ++-
 gnu/dist/texinfo/lib/system.h     |  11 ++++++++---
 gnu/dist/texinfo/makeinfo/files.c |   4 ++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diffs (64 lines):

diff -r 7d09a3cbdbf1 -r b2335d183c1b gnu/dist/texinfo/info/nodes.c
--- a/gnu/dist/texinfo/info/nodes.c     Wed Jan 16 17:10:58 2002 +0000
+++ b/gnu/dist/texinfo/info/nodes.c     Wed Jan 16 17:22:37 2002 +0000
@@ -1,5 +1,5 @@
 /* nodes.c -- how to get an Info file and node.
-   $Id: nodes.c,v 1.1.1.2 2001/07/25 16:20:50 assar Exp $
+   $Id: nodes.c,v 1.2 2002/01/16 17:22:37 tv Exp $
 
    Copyright (C) 1993, 98, 99 Free Software Foundation, Inc.
 
@@ -152,6 +152,7 @@
   if (strcmp (nodename, "*") == 0)
     {
       node = (NODE *)xmalloc (sizeof (NODE));
+      memset (node, 0, sizeof (NODE));
       node->filename = file_buffer->fullpath;
       node->parent   = NULL;
       node->nodename = xstrdup ("*");
diff -r 7d09a3cbdbf1 -r b2335d183c1b gnu/dist/texinfo/lib/system.h
--- a/gnu/dist/texinfo/lib/system.h     Wed Jan 16 17:10:58 2002 +0000
+++ b/gnu/dist/texinfo/lib/system.h     Wed Jan 16 17:22:37 2002 +0000
@@ -1,5 +1,5 @@
 /* system.h: system-dependent declarations; include this first.
-   $Id: system.h,v 1.3 2001/07/25 16:46:19 assar Exp $
+   $Id: system.h,v 1.4 2002/01/16 17:22:38 tv Exp $
 
    Copyright (C) 1997, 98, 99 Free Software Foundation, Inc.
 
@@ -162,9 +162,14 @@
 # define IS_ABSOLUTE(n)        (IS_SLASH((n)[0]) || ((n)[0] && (n)[1] == ':'))
 # define FILENAME_CMP  strcasecmp
 # define FILENAME_CMPN strncasecmp
-# define PATH_SEP      ";"
+# ifdef __unix__
+#  define PATH_SEP     ":"
+#  define DEFAULT_TMPDIR "/tmp/"
+# else
+#  define PATH_SEP     ";"
+#  define DEFAULT_TMPDIR "c:/"
+# endif
 # define STRIP_DOT_EXE 1
-# define DEFAULT_TMPDIR        "c:/"
 # define PIPE_USE_FORK 0
 #else  /* not O_BINARY */
 # define SET_BINARY(f) (void)0
diff -r 7d09a3cbdbf1 -r b2335d183c1b gnu/dist/texinfo/makeinfo/files.c
--- a/gnu/dist/texinfo/makeinfo/files.c Wed Jan 16 17:10:58 2002 +0000
+++ b/gnu/dist/texinfo/makeinfo/files.c Wed Jan 16 17:22:37 2002 +0000
@@ -1,5 +1,5 @@
 /* files.c -- file-related functions for Texinfo.
-   $Id: files.c,v 1.1.1.1 2001/07/25 16:20:57 assar Exp $
+   $Id: files.c,v 1.2 2002/01/16 17:22:38 tv Exp $
 
    Copyright (C) 1998, 99 Free Software Foundation, Inc.
 
@@ -158,7 +158,7 @@
     goto error_exit;
 
   /* Load the file, with enough room for a newline and a null. */
-  result = xmalloc (file_size + 2);
+  result = xmalloc (file_size * 2);
 
   /* VMS stat lies about the st_size value.  The actual number of
      readable bytes is always less than this value.  The arcane



Home | Main Index | Thread Index | Old Index