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

Bug#157304: dpkg: [PATCH] nfstrnsave reads 1 byte past end of allocated memory blocks



Package: dpkg
Version: 1.10.4
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

obstack_copy0 automatically adds the null character and fixes the problem.

- --- dpkg-1.10.4/lib/nfmalloc.c~	2002-05-06 18:18:15.000000000 +0200
+++ dpkg-1.10.4/lib/nfmalloc.c	2002-08-19 21:07:10.000000000 +0200
@@ -59,8 +59,7 @@
 char *nfstrnsave(const char *string, int l) {
   char *ret;
   OBSTACK_INIT;
- -  ret = obstack_copy (&db_obs, string, l + 1);
- -  *(ret + l) = 0;
+  ret = obstack_copy0 (&db_obs, string, l);
   return ret;
 }

- -- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux ldb 2.4.18 #13 Thu May 30 17:49:58 CEST 2002 i686
Locale: LANG=C, LC_CTYPE=it_IT@euro

Versions of packages dpkg depends on:
ii  dselect                       1.10.4     a user tool to manage Debian packa
ii  libc6                         2.2.5-14   GNU C Library: Shared libraries an

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9YUR5djkty3ft5+cRAiy/AJ9GlgJD8gamnAKCuOAQyhKe4NZj5wCdGlY3
FCPokx1OcO7kgt+8KtQI/wI=
=nWjQ
-----END PGP SIGNATURE-----



Reply to: