mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-08 10:20:15 +00:00
intl: Avoid -Wuse-after-free [BZ #26779]
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 7845064d2d
)
This commit is contained in:
parent
bbe4bbb6e8
commit
d36f457870
@ -318,6 +318,14 @@ read_alias_file (const char *fname, int fname_len)
|
|||||||
|
|
||||||
if (string_space_act + alias_len + value_len > string_space_max)
|
if (string_space_act + alias_len + value_len > string_space_max)
|
||||||
{
|
{
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
|
||||||
|
#if defined __GNUC__ && __GNUC__ >= 12
|
||||||
|
/* Suppress the valid GCC 12 warning until the code below is changed
|
||||||
|
to avoid using pointers to the reallocated block. */
|
||||||
|
# pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Increase size of memory pool. */
|
/* Increase size of memory pool. */
|
||||||
size_t new_size = (string_space_max
|
size_t new_size = (string_space_max
|
||||||
+ (alias_len + value_len > 1024
|
+ (alias_len + value_len > 1024
|
||||||
@ -351,6 +359,8 @@ read_alias_file (const char *fname, int fname_len)
|
|||||||
value, value_len);
|
value, value_len);
|
||||||
string_space_act += value_len;
|
string_space_act += value_len;
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
++nmap;
|
++nmap;
|
||||||
++added;
|
++added;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user