Fix ebrowse -f buffer overflow
* lib-src/ebrowse.c (main): Fix buffer overflow when several -f options are given. Found by GCC 13 -Wanalyzer-allocation-size.
This commit is contained in:
parent
8c0671b9cb
commit
3e3f34d71e
1 changed files with 3 additions and 2 deletions
|
@ -3767,8 +3767,9 @@ main (int argc, char **argv)
|
|||
if (n_input_files == input_filenames_size)
|
||||
{
|
||||
input_filenames_size = max (10, 2 * input_filenames_size);
|
||||
input_filenames = (char **) xrealloc ((void *)input_filenames,
|
||||
input_filenames_size);
|
||||
input_filenames = xrealloc (input_filenames,
|
||||
(input_filenames_size
|
||||
* sizeof *input_filenames));
|
||||
}
|
||||
input_filenames[n_input_files++] = xstrdup (optarg);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue