All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-oe][PATCH 3/3] ltrace: Fix build with gcc10
Date: Wed, 25 Dec 2019 08:57:09 -0800	[thread overview]
Message-ID: <20191225165709.2123137-3-raj.khem@gmail.com> (raw)
In-Reply-To: <20191225165709.2123137-1-raj.khem@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-struct-pointers-are-null-initilized.patch | 46 +++++++++++++++++++
 ...hook-Do-not-append-int-to-std-string.patch |  2 +-
 meta-oe/recipes-devtools/ltrace/ltrace_git.bb |  1 +
 3 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch

diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch
new file mode 100644
index 0000000000..9def41ca60
--- /dev/null
+++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch
@@ -0,0 +1,46 @@
+From 67a8fa478a4484bc4dbfb3ac74e11be1dd5af594 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Dec 2019 19:35:48 -0800
+Subject: [PATCH] ensure the struct pointers are null initilized
+
+Do not delete if pointer is already null
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ expr.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/expr.c b/expr.c
+index 4059a32..5ffd0ad 100644
+--- a/expr.c
++++ b/expr.c
+@@ -189,10 +189,8 @@ int
+ expr_clone(struct expr_node *retp, const struct expr_node *node)
+ {
+ 	*retp = *node;
+-
++	struct expr_node *nlhs = 0, *nrhs = 0;
+ 	switch (node->kind) {
+-		struct expr_node *nlhs;
+-		struct expr_node *nrhs;
+ 
+ 	case EXPR_OP_ARGNO:
+ 	case EXPR_OP_SELF:
+@@ -236,8 +234,10 @@ expr_clone(struct expr_node *retp, const struct expr_node *node)
+ 		if (expr_alloc_and_clone(&nlhs, node->lhs, node->own_lhs) < 0) {
+ 			if (node->kind == EXPR_OP_CALL2
+ 			    && node->u.call.own_rhs) {
+-				expr_destroy(nrhs);
+-				free(nrhs);
++				if (nrhs) {
++					expr_destroy(nrhs);
++					free(nrhs);
++				}
+ 				return -1;
+ 			}
+ 		}
+-- 
+2.24.1
+
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch
index 8f1c4b9b9b..2890373821 100644
--- a/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch
+++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-hook-Do-not-append-int-to-std-string.patch
@@ -23,7 +23,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  	if (sysconfdir != NULL && *sysconfdir != '\0') {
  		/* No +1, we skip the initial period.  */
 -		syspath = malloc(strlen(sysconfdir) + sizeof FN);
-+		syspath = malloc(strlen(sysconfdir) + sizeof FN + 1);
++		syspath = malloc(strlen(sysconfdir) + sizeof FN + 2);
 +		syspath[strlen(sysconfdir) + sizeof FN + 1] = '\0';
  		if (syspath == NULL
 -		    || sprintf(syspath, "%s/%s", sysconfdir, FN + 1) < 0)
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
index bb21cbca8a..6b66c25297 100644
--- a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
+++ b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
@@ -28,6 +28,7 @@ SRC_URI = "git://github.com/sparkleholic/ltrace.git;branch=master;protocol=http
            file://0001-hook-Do-not-append-int-to-std-string.patch \
            file://include_unistd_nr.patch \
            file://0001-Bug-fix-for-data-type-length-judgment.patch \
+           file://0001-ensure-the-struct-pointers-are-null-initilized.patch \
            "
 S = "${WORKDIR}/git"
 
-- 
2.24.1



      parent reply	other threads:[~2019-12-25 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-25 16:57 [meta-oe][PATCH 1/3] upm: Fix 'may be used uninitialized' errors Khem Raj
2019-12-25 16:57 ` [meta-networking][PATCH 2/3] memcached: upgrade to 1.5.20 Khem Raj
2019-12-25 16:57 ` Khem Raj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191225165709.2123137-3-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.