Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71074 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45659 invoked from network); 11 Jan 2014 23:18:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2014 23:18:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:32844] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/E1-36150-131D1D25 for ; Sat, 11 Jan 2014 18:18:10 -0500 Received: by mail-lb0-f178.google.com with SMTP id u14so397971lbd.23 for ; Sat, 11 Jan 2014 15:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=iLegZ3syr0XYE3zNtXH+Sj+6Fqz83MKDWShkUGN7GHg=; b=Jv/+VLnyW/TowaL2Yrhmx5xZXxiVt9UGZxKg4psni7xV3yBW7z1oDSDjZFP42I/9An GfzuqOerP3oxw+6eA2aTnZTzhcwARIsfJjjU1xrTw8Ff23FH6f2lvkUstsQy11ScXGYY cm7YuMCQCbzSPo+Z+D5kDUetns2uDkheaOrWesXCReeozSeKNMZ6YUbAfkoemT5Pcvye e5zYAqnlovIzyQYikqngHnCfxa7B3mdO02zAfhgAVdM6fUzqWZUuKUjG+80keJHyPAmm O1PdfmshedRoJcQFL6b6snuDGVe47v7pEJRaNvLYLVOAyA9Gr1ezbWToncGwVgiocF/P FO7g== X-Received: by 10.152.120.7 with SMTP id ky7mr80757lab.83.1389482286380; Sat, 11 Jan 2014 15:18:06 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.6.68 with HTTP; Sat, 11 Jan 2014 15:17:26 -0800 (PST) Date: Sun, 12 Jan 2014 08:17:26 +0900 X-Google-Sender-Auth: TWdrDO3fV-0MuJc5BBJC85ZT4Sk Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0117690d19fb8404efba0eba Subject: exif int overflow patch is not applied to 5.3? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0117690d19fb8404efba0eba Content-Type: text/plain; charset=UTF-8 Hi all, 5.4.24/5.5.8 have this patch diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 2fe54f7..c531d8d 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2852,7 +2852,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); /* If its bigger than 4 bytes, the dir entry contains an offset. */ value_ptr = offset_base+offset_val; - if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry) { + /* + dir_entry is ImageInfo->file.list[sn].data+2+i*12 + offset_base is ImageInfo->file.list[sn].data-dir_offset + dir_entry - offset_base is dir_offset+2+i*12 + */ + if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) /* It is important to check for IMAGE_FILETYPE_TIFF * JPEG does not use absolute pointers instead its pointers are * relative to the start of the TIFF header in APP1 section. */ https://bugs.php.net/bug.php?id=65873 Is this applicable to 5.3, isn't this? I don't understand details of this patch, but it sounds this is required fix for 5.3. Could anyone give clarification? Thank you. -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0117690d19fb8404efba0eba--