forked from openembedded/meta-openembedded
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Khem Raj <[email protected]>
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
.../recipes-devtools/ltrace/ltrace/0001-ensure-the-struct-pointers-are-null-initilized.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From 67a8fa478a4484bc4dbfb3ac74e11be1dd5af594 Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <[email protected]> | ||
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 <[email protected]> | ||
--- | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ Signed-off-by: Khem Raj <[email protected]> | |
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters