diff options
3 files changed, 48 insertions, 1 deletions
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 @@ | |||
| 1 | From 67a8fa478a4484bc4dbfb3ac74e11be1dd5af594 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 23 Dec 2019 19:35:48 -0800 | ||
| 4 | Subject: [PATCH] ensure the struct pointers are null initilized | ||
| 5 | |||
| 6 | Do not delete if pointer is already null | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | expr.c | 10 +++++----- | ||
| 13 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/expr.c b/expr.c | ||
| 16 | index 4059a32..5ffd0ad 100644 | ||
| 17 | --- a/expr.c | ||
| 18 | +++ b/expr.c | ||
| 19 | @@ -189,10 +189,8 @@ int | ||
| 20 | expr_clone(struct expr_node *retp, const struct expr_node *node) | ||
| 21 | { | ||
| 22 | *retp = *node; | ||
| 23 | - | ||
| 24 | + struct expr_node *nlhs = 0, *nrhs = 0; | ||
| 25 | switch (node->kind) { | ||
| 26 | - struct expr_node *nlhs; | ||
| 27 | - struct expr_node *nrhs; | ||
| 28 | |||
| 29 | case EXPR_OP_ARGNO: | ||
| 30 | case EXPR_OP_SELF: | ||
| 31 | @@ -236,8 +234,10 @@ expr_clone(struct expr_node *retp, const struct expr_node *node) | ||
| 32 | if (expr_alloc_and_clone(&nlhs, node->lhs, node->own_lhs) < 0) { | ||
| 33 | if (node->kind == EXPR_OP_CALL2 | ||
| 34 | && node->u.call.own_rhs) { | ||
| 35 | - expr_destroy(nrhs); | ||
| 36 | - free(nrhs); | ||
| 37 | + if (nrhs) { | ||
| 38 | + expr_destroy(nrhs); | ||
| 39 | + free(nrhs); | ||
| 40 | + } | ||
| 41 | return -1; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | -- | ||
| 45 | 2.24.1 | ||
| 46 | |||
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> | |||
| 23 | if (sysconfdir != NULL && *sysconfdir != '\0') { | 23 | if (sysconfdir != NULL && *sysconfdir != '\0') { |
| 24 | /* No +1, we skip the initial period. */ | 24 | /* No +1, we skip the initial period. */ |
| 25 | - syspath = malloc(strlen(sysconfdir) + sizeof FN); | 25 | - syspath = malloc(strlen(sysconfdir) + sizeof FN); |
| 26 | + syspath = malloc(strlen(sysconfdir) + sizeof FN + 1); | 26 | + syspath = malloc(strlen(sysconfdir) + sizeof FN + 2); |
| 27 | + syspath[strlen(sysconfdir) + sizeof FN + 1] = '\0'; | 27 | + syspath[strlen(sysconfdir) + sizeof FN + 1] = '\0'; |
| 28 | if (syspath == NULL | 28 | if (syspath == NULL |
| 29 | - || sprintf(syspath, "%s/%s", sysconfdir, FN + 1) < 0) | 29 | - || 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 | |||
| 28 | file://0001-hook-Do-not-append-int-to-std-string.patch \ | 28 | file://0001-hook-Do-not-append-int-to-std-string.patch \ |
| 29 | file://include_unistd_nr.patch \ | 29 | file://include_unistd_nr.patch \ |
| 30 | file://0001-Bug-fix-for-data-type-length-judgment.patch \ | 30 | file://0001-Bug-fix-for-data-type-length-judgment.patch \ |
| 31 | file://0001-ensure-the-struct-pointers-are-null-initilized.patch \ | ||
| 31 | " | 32 | " |
| 32 | S = "${WORKDIR}/git" | 33 | S = "${WORKDIR}/git" |
| 33 | 34 | ||
