diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-05-14 18:51:22 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-05-14 19:28:10 -0700 |
commit | 3e3f34d71e9c3c6c943580dc822afed7a3b0a861 (patch) | |
tree | d09abd31afc1998fa7e96f60d50ba7bb5c68e353 | |
parent | 8c0671b9cbf56bec99a7de63ead33076abb754b1 (diff) | |
download | emacs-3e3f34d71e9c3c6c943580dc822afed7a3b0a861.tar.gz |
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.
-rw-r--r-- | lib-src/ebrowse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 371fa6c938b..4b71f7447e0 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -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; |