[rebase - The rebase tool, core of the automatic rebase facility during postinstall] branch master, updated. a7d415a25c1b902a98dbc2b0e2fd8928b58e3f61
corinna@sourceware.org
corinna@sourceware.org
Mon Jul 17 09:01:00 GMT 2017
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)
{
More information about the Cygwin-apps-cvs
mailing list