]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Merge branch 'analyzer1' of https://github.com/t-8ch/util-linux
authorKarel Zak <kzak@redhat.com>
Mon, 25 Sep 2023 10:32:25 +0000 (12:32 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 25 Sep 2023 10:32:25 +0000 (12:32 +0200)
* '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

1  2 
libmount/src/cache.c
login-utils/lslogins.c
text-utils/more.c

Simple merge
Simple merge
index 1dbe51334d64ecee17be5421b08f6129cb3a9bb6,e25b0e24ce0d3dea115f407b71d1a228bdb75d17..bd19d849acc3a21c9f30f0115b2052c1fe041dce
@@@ -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);