[patch] Fix a couple of null-derefs in setup.exe

Dave Korn dave.korn.cygwin@googlemail.com
Fri Sep 18 11:33:00 GMT 2009


    Hi gang,

  There are a couple of places where setup can bomb if you blow away your
stored settings (cached mirror list or last mirror), as it gets a null pointer
on trying to read them back; both strtok and the std::string(const char *)
ctor blow up on this.  Attached patch trivially protects against both.

	* site.cc (get_site_list): Use empty string if user settings
	return NULL pointer for cached mirrors list.
	(SiteSetting::getSavedSites): Do nothing if user settings return
	NULL pointer for last mirror URL.

  Ok?

    cheers,
      DaveK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup-null-deref-fix.diff
Type: text/x-c
Size: 837 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20090918/237a68fa/attachment.bin>


More information about the Cygwin-apps mailing list