[oe-commits] [openembedded-core] 02/25: bash: memleak bug fix for builtin command read
git at git.openembedded.org
git at git.openembedded.org
Sun Aug 27 21:30:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit a2b278a6eaa9e9b48d858e3be6712267c0122598
Author: Zhang Xiao <xiao.zhang at windriver.com>
AuthorDate: Fri Aug 25 08:42:38 2017 +0800
bash: memleak bug fix for builtin command read
Built in command "read" with "-e" use Readline to obtain the line
in an interactive shell. In this process, a string "rlbuf" is
just allocated without free operation thus cause memory leak.
This patch had been submitted to upstream:
http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html
Signed-off-by: Zhang Xiao <xiao.zhang at windriver.com>
Signed-off-by: Yi Zhao <yi.zhao at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
...-memleak-bug-fix-for-builtin-command-read.patch | 35 ++++++++++++++++++++++
meta/recipes-extended/bash/bash_4.4.bb | 1 +
2 files changed, 36 insertions(+)
diff --git a/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch b/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch
new file mode 100644
index 0000000..9fb6ba9
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch
@@ -0,0 +1,35 @@
+From d3b6303a6853f612a56848ee4e59eaa0b0ab9489 Mon Sep 17 00:00:00 2001
+From: Zhang Xiao <xiao.zhang at windriver.com>
+Date: Tue, 21 Feb 2017 11:30:14 +0800
+Subject: [PATCH] bash: memleak bug fix for builtin command read
+
+Built in command "read" with "-e" use Readline to obtain the line
+in an interactive shell. In this process, a string "rlbuf" is
+just allocated without free operation thus cause memory leak. Fix it.
+
+Upstream-Status: Submitted [http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html]
+
+Signed-off-by: Zhang Xiao <xiao.zhang at windriver.com>
+---
+ builtins/read.def | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/builtins/read.def b/builtins/read.def
+index 4397154..ee0c5a6 100644
+--- a/builtins/read.def
++++ b/builtins/read.def
+@@ -674,6 +674,11 @@ add_char:
+ input_string[i] = '\0';
+ CHECK_ALRM;
+
++#if defined (READLINE)
++ if (edit)
++ xfree (rlbuf);
++#endif
++
+ if (retval < 0)
+ {
+ t_errno = errno;
+--
+1.9.1
+
diff --git a/meta/recipes-extended/bash/bash_4.4.bb b/meta/recipes-extended/bash/bash_4.4.bb
index b602afe..e544d07 100644
--- a/meta/recipes-extended/bash/bash_4.4.bb
+++ b/meta/recipes-extended/bash/bash_4.4.bb
@@ -25,6 +25,7 @@ SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
file://run-ptest \
file://fix-run-builtins.patch \
file://0001-help-fix-printf-format-security-warning.patch \
+ file://bash-memleak-bug-fix-for-builtin-command-read.patch \
"
SRC_URI[tarball.md5sum] = "148888a7c95ac23705559b6f477dfe25"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list