All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH lttng-tools] Fix: null dereference on error path for create_ctx_type
       [not found] <1484665727-24204-1-git-send-email-jonathan.rajotte-julien@efficios.com>
@ 2017-01-26  0:32 ` Jérémie Galarneau
  0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2017-01-26  0:32 UTC (permalink / raw)
  To: Jonathan Rajotte; +Cc: lttng-dev, Jeremie Galarneau

Merged in master, stable-2.9 and stable-2.8.

Thanks!
Jérémie

On 17 January 2017 at 10:08, Jonathan Rajotte
<jonathan.rajotte-julien@efficios.com> wrote:
> When zmalloc of type->opt fail the destroy_ctx_type would result in a
> null dereference.
>
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
> ---
>  src/bin/lttng/commands/add_context.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c
> index 5fc65bf..df722bb 100644
> --- a/src/bin/lttng/commands/add_context.c
> +++ b/src/bin/lttng/commands/add_context.c
> @@ -662,7 +662,9 @@ void destroy_ctx_type(struct ctx_type *type)
>         if (!type) {
>                 return;
>         }
> -       free(type->opt->symbol);
> +       if (type->opt) {
> +               free(type->opt->symbol);
> +       }
>         free(type->opt);
>         free(type);
>  }
> --
> 2.7.4
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH lttng-tools] Fix: null dereference on error path for create_ctx_type
@ 2017-01-17 15:08 Jonathan Rajotte
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Rajotte @ 2017-01-17 15:08 UTC (permalink / raw)
  To: lttng-dev; +Cc: jgalar

When zmalloc of type->opt fail the destroy_ctx_type would result in a
null dereference.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
---
 src/bin/lttng/commands/add_context.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c
index 5fc65bf..df722bb 100644
--- a/src/bin/lttng/commands/add_context.c
+++ b/src/bin/lttng/commands/add_context.c
@@ -662,7 +662,9 @@ void destroy_ctx_type(struct ctx_type *type)
 	if (!type) {
 		return;
 	}
-	free(type->opt->symbol);
+	if (type->opt) {
+		free(type->opt->symbol);
+	}
 	free(type->opt);
 	free(type);
 }
-- 
2.7.4

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-26  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1484665727-24204-1-git-send-email-jonathan.rajotte-julien@efficios.com>
2017-01-26  0:32 ` [PATCH lttng-tools] Fix: null dereference on error path for create_ctx_type Jérémie Galarneau
2017-01-17 15:08 Jonathan Rajotte

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.