public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
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
Date: Thu, 01 Sep 2016 18:22:00 -0000	[thread overview]
Message-ID: <20160901182255.56183.qmail@sourceware.org> (raw)




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)


                 reply	other threads:[~2016-09-01 18:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160901182255.56183.qmail@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).