[Reproducible-commits] [dpkg] 21/61: dpkg-deb: Fix off-by-one write access on versionbuf variable

Jérémy Bobbio lunar at moszumanska.debian.org
Mon Sep 21 09:56:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit e65aa3db04eb908c9507d5d356a95cedb890814d
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Sep 6 21:25:00 2015 +0200

    dpkg-deb: Fix off-by-one write access on versionbuf variable
    
    Closes: #798324
    Warned-by: afl
    Reported-by: Jacek Wielemborek <d33tah at gmail.com>
    Stable-Candidate: 1.16.x 1.17.x
---
 debian/changelog   | 2 ++
 dpkg-deb/extract.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index ace9a74..d45049b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,8 @@ dpkg (1.18.3) UNRELEASED; urgency=low
   * Add kfreebsd-armhf support to ostable and triplettable. Closes: #796283
     Thanks to Steven Chamberlain <steven at pyro.eu.org>.
   * Fix «dpkg --verify» with --root.
+  * Fix an off-by-one write access in dpkg-deb when parsing the .deb magic.
+    Reported by Jacek Wielemborek <d33tah at gmail.com>. Closes: #798324
   * Perl modules:
     - Only warn on invalid week days instead of aborting in
       Dpkg::Changelog::Entry::Debian. Regression introduced in dpkg 1.18.2.
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c
index d5ac05c..1d2a76a 100644
--- a/dpkg-deb/extract.c
+++ b/dpkg-deb/extract.c
@@ -131,7 +131,7 @@ extracthalf(const char *debar, const char *dir,
   if (fstat(arfd, &stab))
     ohshite(_("failed to fstat archive"));
 
-  r = read_line(arfd, versionbuf, strlen(DPKG_AR_MAGIC), sizeof(versionbuf));
+  r = read_line(arfd, versionbuf, strlen(DPKG_AR_MAGIC), sizeof(versionbuf) - 1);
   if (r < 0)
     read_fail(r, debar, _("archive magic version number"));
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list