sysusers: make sure to reset the returned value when EOF is reached in fget*ent_sane() wrappers (#8737)

To indicate that the there're no more entries, these wrappers return false but
did leave the passed pointed unmodified.

However EOF is not an error and is a very common case so initialize the output
argument to NULL even in this case so callers don't need to do that.

Fixes: #8721
This commit is contained in:
Franck Bui
2018-04-18 18:32:21 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 613bddf7d1
commit 80359410c4
6 changed files with 15 additions and 20 deletions
@@ -0,0 +1,2 @@
root:x:0:
systemd-coredump:x:1:
@@ -0,0 +1,2 @@
root:x:0:0:root:/root:/bin/bash
systemd-coredump:x:1:1:systemd Core Dumper:/:/sbin/nologin
@@ -0,0 +1 @@
root:x:0:
@@ -0,0 +1 @@
root:x:0:0:root:/root:/bin/bash
+1
View File
@@ -0,0 +1 @@
u systemd-coredump 1 "systemd Core Dumper"