1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Properly fix the a2ps crash within included gettext. Map pointers

should be recalculated if realloc moves the memory block they used
to point to.
This commit is contained in:
Alexander Kabaev 2003-08-12 15:27:02 +00:00
parent dd27fee890
commit 52ef3242e8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=86828

View File

@ -1,19 +1,20 @@
--- intl/localealias.c.orig Tue Aug 31 19:29:35 1999
+++ intl/localealias.c Sun Jul 6 05:35:31 2003
@@ -333,12 +333,12 @@
--- intl/localealias.c.orig Tue Aug 31 13:29:35 1999
+++ intl/localealias.c Tue Aug 12 11:09:53 2003
@@ -329,6 +329,17 @@
FREE_BLOCKS (block_list);
return added;
}
+ if (string_space != new_pool)
+ {
+ size_t i;
+
+ for (i = 0; i < nmap; i++)
+ {
+ map[i].alias += new_pool - string_space;
+ map[i].value += new_pool - string_space;
+ }
+ }
+
string_space = new_pool;
string_space_max = new_size;
}
- map[nmap].alias = memcpy (&string_space[string_space_act],
- alias, alias_len);
+ memcpy (&string_space[string_space_act], alias, alias_len);
+ map[nmap].alias = &string_space[string_space_act];
string_space_act += alias_len;
- map[nmap].value = memcpy (&string_space[string_space_act],
- value, value_len);
+ memcpy (&string_space[string_space_act], value, value_len);
+ map[nmap].value = &string_space[string_space_act];
string_space_act += value_len;
++nmap;