From: Karel Zak Date: Mon, 25 Sep 2023 10:32:25 +0000 (+0200) Subject: Merge branch 'analyzer1' of https://github.com/t-8ch/util-linux X-Git-Tag: v2.40-rc1~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f861c1b37dbaae063266fcdb90ba966cb73e73f0;p=thirdparty%2Futil-linux.git Merge branch 'analyzer1' of https://github.com/t-8ch/util-linux * 'analyzer1' of https://github.com/t-8ch/util-linux: libsmartcols: handle nameless tables in export format ldattach: don't call exit() from signal handler lslogins: fix realloc() loop allocation size more: avoid out-of-bound access libfdisk: handle allocation failure in fdisk_new_partition lib/env: fix function name remote_entry -> remove_entry libmount: gracefully handle NULL path in mnt_resolve_target() libblkid: avoid memory leak of cachefile path lib/env: avoid underflow of read_all_alloc() return value --- f861c1b37dbaae063266fcdb90ba966cb73e73f0 diff --cc text-utils/more.c index 1dbe51334d,e25b0e24ce..bd19d849ac --- a/text-utils/more.c +++ b/text-utils/more.c @@@ -356,11 -356,11 +356,11 @@@ static void env_argscan(struct more_con env_argv = xmalloc(sizeof(char *) * size); env_argv[0] = _("MORE environment variable"); /* program name */ for (tok = strtok_r(str, delim, &key); tok; tok = strtok_r(NULL, delim, &key)) { - env_argv[env_argc++] = tok; - if (size < env_argc) { + if (size == env_argc) { size *= 2; - env_argv = xrealloc(env_argv, sizeof(char *) * size); + env_argv = xreallocarray(env_argv, size, sizeof(char *)); } + env_argv[env_argc++] = tok; } argscan(ctl, env_argc, env_argv);