pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/chat/ircII avoid a crash when setting IRCIISERVER. ol...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1d897da27fe0
branches:  trunk
changeset: 332857:1d897da27fe0
user:      mrg <mrg%pkgsrc.org@localhost>
date:      Fri Apr 26 00:12:14 2019 +0000

description:
avoid a crash when setting IRCIISERVER.  older free() must hae been
less grumpy about passing data it didn't know about ..

pointed out by bad@.

diffstat:

 chat/ircII/distinfo                      |   3 +-
 chat/ircII/patches/patch-source_server.c |  36 ++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletions(-)

diffs (53 lines):

diff -r e68984bbf0c5 -r 1d897da27fe0 chat/ircII/distinfo
--- a/chat/ircII/distinfo       Thu Apr 25 23:57:49 2019 +0000
+++ b/chat/ircII/distinfo       Fri Apr 26 00:12:14 2019 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.50 2019/01/18 10:47:48 mrg Exp $
+$NetBSD: distinfo,v 1.51 2019/04/26 00:12:14 mrg Exp $
 
 SHA1 (ircii-20190117.tar.bz2) = 5e727cecd311117b0768586d37bf2126fb0fd7b7
 RMD160 (ircii-20190117.tar.bz2) = 2536c7783ca2ee9df0b49877858b65ccfc3e9bea
 SHA512 (ircii-20190117.tar.bz2) = 08ca96cd62bae35245b40791c8588752b96136b53e5c9434d0f7976d03841fca80e8c83cf8608aad79c381820b06e00167447c6dc0c6294c6b3dfd91a9fdb6d4
 Size (ircii-20190117.tar.bz2) = 606327 bytes
 SHA1 (patch-Makefile.in) = 77fd2cfb1ef528faf03a3ef61c4802917fb6c8d5
+SHA1 (patch-source_server.c) = cfcaac144030c1c5ed907e940026dbdefc6897f4
diff -r e68984bbf0c5 -r 1d897da27fe0 chat/ircII/patches/patch-source_server.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/ircII/patches/patch-source_server.c  Fri Apr 26 00:12:14 2019 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-source_server.c,v 1.1 2019/04/26 00:12:14 mrg Exp $
+
+- Don't free data that came from the environment.
+
+Index: source/server.c
+===================================================================
+RCS file: /home/cvs/ircii/source/server.c,v
+retrieving revision 1.245
+retrieving revision 1.246
+diff -p -u -r1.245 -r1.246
+--- source/server.c    5 Feb 2019 01:35:49 -0000       1.245
++++ source/server.c    26 Apr 2019 00:08:33 -0000      1.246
+@@ -1796,17 +1796,19 @@ read_server_file(void)
+ {
+       FILE *fp;
+       u_char format[11];
+-      u_char *file_path = NULL;
++      u_char *file_path;
++      u_char *free_path = NULL;
+       u_char  buffer[FS_BUFFER_SIZE];
+ 
+       if ((file_path = my_getenv("IRCSERVERSFILE")) == NULL)
+       {
+-              malloc_strcpy(&file_path, my_irc_lib());
+-              malloc_strcat(&file_path, UP(SERVERS_FILE));
++              malloc_strcpy(&free_path, my_irc_lib());
++              malloc_strcat(&free_path, UP(SERVERS_FILE));
++              file_path = free_path;
+       }
+       snprintf(CP(format), sizeof format, "%%%ds", (int)sizeof buffer);
+       fp = fopen(CP(file_path), "r");
+-      new_free(&file_path);
++      new_free(&free_path);
+       if (NULL != fp)
+       {
+               while (fscanf(fp, CP(format), buffer) != EOF)



Home | Main Index | Thread Index | Old Index