Paul Eggert wrote:
> I installed the attached patch into Gnulib
> and this should appear in the next coreutils release.
Unfortunately, this patch introduces a memory leak: If
num_sessions == 0 and sessions != NULL (which can happen, according
to the man page), we need to call free (sessions).
Th
Thanks for reporting that. I installed the attached patch into Gnulib
and this should appear in the next coreutils release.From 1e6a26f9312bb47e070f94b17b14dc1a6ffbb74f Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Wed, 30 Aug 2023 18:26:52 -0700
Subject: [PATCH] readutmp: fix core dump if --e
coreutils 9.4 with the --enable-systemd option seg.faults in
lib/readutmp.c, line 801:
for (session_ptr = sessions; *session_ptr != NULL; session_ptr++)
If there is no session, "sessions" is NULL and "*session_ptr" will
dereference a NULL pointer.
Affected are who, pinky and uptime.
A simple f