From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57017 invoked by alias); 1 Sep 2016 18:22:56 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 56291 invoked by uid 9795); 1 Sep 2016 18:22:55 -0000 Date: Thu, 01 Sep 2016 18:22:00 -0000 Message-ID: <20160901182255.56183.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.874-29-gfd57354 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 5c55c7a68870777d8775ff0b3c0bf3d482534824 X-Git-Newrev: fd57354633595ef40d2a46841ed7666837b13a15 X-SW-Source: 2016-q3/txt/msg00022.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=fd57354633595ef40d2a46841ed7666837b13a15 commit fd57354633595ef40d2a46841ed7666837b13a15 Author: Jon Turney Date: Thu Sep 1 19:21:55 2016 +0100 Fix incorrect heap memory access in SimpleSocket::gets() nl is dereferenced to check if it's '\n' or '\r', before we check if we have passed the start of the buffer. Re-order the check so we check if we have passed the start of the buffer first. Detected by Dr.Memory, e.g: Error #7: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x053f3067-0x053f3068 1 byte(s) 0 SimpleSocket::gets [/wip/cygwin-setup/build.x86/../simpsock.cc:177] 1 NetIO_HTTP::NetIO_HTTP [/wip/cygwin-setup/build.x86/../nio-http.cc:195] 2 NetIO::open [/wip/cygwin-setup/build.x86/../netio.cc:154] 3 getUrlToStream [/wip/cygwin-setup/build.x86/../geturl.cc:119] 4 get_url_to_membuf [/wip/cygwin-setup/build.x86/../geturl.cc:161] 5 get_url_to_string [/wip/cygwin-setup/build.x86/../geturl.cc:186] 6 get_site_list [/wip/cygwin-setup/build.x86/../site.cc:324] 7 do_download_site_info_thread@4 [/wip/cygwin-setup/build.x86/../site.cc:410] 8 KERNEL32.dll!BaseThreadInitThunk +0x23 (0x76fb62c4 ) Note: @0:00:20.016 in thread 280888 Note: refers to 1 byte(s) before next malloc Note: next higher malloc: 0x053f3068-0x053f346b Note: prev lower malloc: 0x053f2fc8-0x053f3048 Note: instruction: movzx (%eax) -> %eax Signed-off-by: Jon Turney https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=a64942fcc7719e88c740f5cd07291eb7d9dc6ba6 commit a64942fcc7719e88c740f5cd07291eb7d9dc6ba6 Author: Jon Turney Date: Thu Sep 1 19:12:05 2016 +0100 Clean up some cruft in propsheet.cc Clean up some cruft no longer needed after 67fb0b58 Signed-off-by: Jon Turney Diff: --- propsheet.cc | 17 ----------------- simpsock.cc | 2 +- 2 files changed, 1 insertions(+), 18 deletions(-) diff --git a/propsheet.cc b/propsheet.cc index 016f9d3..9328281 100644 --- a/propsheet.cc +++ b/propsheet.cc @@ -25,23 +25,6 @@ #include "ControlAdjuster.h" #include "choose.h" -//#include -// ...but since there is no shlwapi.h in mingw yet: -typedef struct _DllVersionInfo -{ - DWORD cbSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformID; -} -DLLVERSIONINFO; -typedef HRESULT CALLBACK (*DLLGETVERSIONPROC) (DLLVERSIONINFO * pdvi); - -#ifndef PROPSHEETHEADER_V1_SIZE -#define PROPSHEETHEADER_V1_SIZE 40 -#endif - // Sort of a "hidden" Windows structure. Used in the PropSheetCallback. #include typedef struct DLGTEMPLATEEX diff --git a/simpsock.cc b/simpsock.cc index 88f843b..8b82063 100644 --- a/simpsock.cc +++ b/simpsock.cc @@ -174,7 +174,7 @@ SimpleSocket::gets () if (nl) { getp = nl - buf + 1; - while ((*nl == '\n' || *nl == '\r') && nl >= buf) + while (nl >= buf && (*nl == '\n' || *nl == '\r')) *nl-- = 0; } else if (putp > getp)