Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Nov 2015 21:52:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 204230] [patch] bsdiff(1) - check file size against SIZE_MAX
Message-ID:  <bug-204230-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204230

            Bug ID: 204230
           Summary: [patch] bsdiff(1) - check file size against SIZE_MAX
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: tobias@stoeckmann.org
          Keywords: patch

Created attachment 162714
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=162714&action=edit
proposed fix

When bsdiff opens binary files, it does not properly check if the file size
(off_t 64 bit) is larger than theoretical maximum memory size (size_t 64 or
just 32 bit).

Files that large won't work with the current code, because they clearly run out
of memory. But due to +1 calculation, the integer value can overflow and binary
data is written into unallocated memory (0 bytes), crashing the application.

The fix is simple: If file is too large, handle it as an I/O error.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-204230-8>