This is the mail archive of the cygwin-apps-cvs mailing list for the cygwin-apps project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[setup - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.874-29-gfd57354




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=fd57354633595ef40d2a46841ed7666837b13a15

commit fd57354633595ef40d2a46841ed7666837b13a15
Author: Jon Turney <jon.turney@dronecode.org.uk>
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 <KERNEL32.dll+0x162c4>)
    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 <jon.turney@dronecode.org.uk>

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=a64942fcc7719e88c740f5cd07291eb7d9dc6ba6

commit a64942fcc7719e88c740f5cd07291eb7d9dc6ba6
Author: Jon Turney <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>


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 <shlwapi.h>
-// ...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 <pshpack1.h>
 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]