bash/bash-5.0-patch-9.patch
Petr Šabata 33fc6cffab RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/bash#a6e6d286e4a319b6ca72fd4b4457f11f806f25c1
2020-10-14 22:12:16 +02:00

39 lines
1.1 KiB
Diff

From 9f597fd10993313262cab400bf3c46ffb3f6fd1e Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Wed, 14 Aug 2019 14:58:44 -0400
Subject: [PATCH] Bash-5.0 patch 9: fix file descriptor leak with zero-length
history file
---
lib/readline/histfile.c | 1 +
patchlevel.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/readline/histfile.c b/lib/readline/histfile.c
index dc64bde1..a8a92aa3 100644
--- a/lib/readline/histfile.c
+++ b/lib/readline/histfile.c
@@ -305,6 +305,7 @@ read_history_range (const char *filename, int from, int to)
if (file_size == 0)
{
free (input);
+ close (file);
return 0; /* don't waste time if we don't have to */
}
diff --git a/patchlevel.h b/patchlevel.h
index 16c87404..02f1d606 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 8
+#define PATCHLEVEL 9
#endif /* _PATCHLEVEL_H_ */
--
2.21.0