public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: corinna@sourceware.org
To: cygwin-apps-cvs@sourceware.org
Subject: [rebase - The rebase tool, core of the automatic rebase facility during postinstall] branch master, updated. a7d415a25c1b902a98dbc2b0e2fd8928b58e3f61
Date: Mon, 17 Jul 2017 09:01:00 -0000	[thread overview]
Message-ID: <20170717090149.7124.qmail@sourceware.org> (raw)




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

commit a7d415a25c1b902a98dbc2b0e2fd8928b58e3f61
Author: Corinna Vinschen <vinschen@redhat.com>
Date:   Mon Jul 17 11:01:41 2017 +0200

    handle "out of available DLL slots" condition
    
    Signed-off-by: Corinna Vinschen <vinschen@redhat.com>


Diff:
---
 rebase.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/rebase.c b/rebase.c
index 9504a48..5b52f76 100644
--- a/rebase.c
+++ b/rebase.c
@@ -243,7 +243,8 @@ main (int argc, char *argv[])
       /* Rebase with database support. */
       BOOL header;
 
-      merge_image_info ();
+      if (merge_image_info () < 0)
+	return 2;
       status = TRUE;
       for (i = 0; i < img_info_size; ++i)
 	if (img_info_list[i].flag.needs_rebasing)
@@ -745,12 +746,21 @@ merge_image_info ()
       ULONG64 new_base;
 
       /* Skip trailing entries as long as there is no hole. */
-       while (img_info_list[end].base + img_info_list[end].slot_size + offset
-	     >= floating_image_base)
+       while (end > 0
+	      && img_info_list[end].base + img_info_list[end].slot_size
+		 + offset >= floating_image_base)
 	{
 	  floating_image_base = img_info_list[end].base;
 	  --end;
 	}
+      /* No hole?  We're in serious trouble! */
+      if (end <= 0)
+	{
+	  fprintf (stderr,
+		   "%s: Too many DLLs for available address space: %s\n",
+		   progname, strerror (ENOMEM));
+	  return -1;
+	}
       /* Test if one of the DLLs with address 0 fits into the hole. */
       for (i = 0, new_base = 0; img_info_list[i].base == 0; ++i, new_base = 0)
 	{


                 reply	other threads:[~2017-07-17  9:01 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=20170717090149.7124.qmail@sourceware.org \
    --to=corinna@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).