[Pkg-shadow-commits] Patch against UB in src/faillog.c

mateusz_tabaka mateusz_tabaka at wp.pl
Thu Jan 15 18:19:27 UTC 2015


Hi, this is a small patch against UB found by cppcheck.

Thanks.

--- src/faillog.c.orig	2015-01-14 22:33:47.689401000 +0100
+++ src/faillog.c	2015-01-14 22:34:55.009401000 +0100
@@ -724,8 +724,7 @@
  	if (lflg || mflg || rflg) {
  		if (   (ferror (fail) != 0)
  		    || (fflush (fail) != 0)
-		    || (fsync  (fileno (fail)) != 0)
-		    || (fclose (fail) != 0)) {
+		    || (fsync  (fileno (fail)) != 0)) {
  			fprintf (stderr,
  			         _("%s: Failed to write %s: %s\n"),
  			         Prog, FAILLOG_FILE, strerror (errno));



More information about the Pkg-shadow-commits mailing list