From: David Goulet Date: Tue, 8 Nov 2011 19:30:20 +0000 (-0500) Subject: Fix possible NULL pointer dereference X-Git-Tag: v2.0-pre15~143 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1f3580c7152869e3827f475a713a9567f8357bc8;p=lttng-tools.git Fix possible NULL pointer dereference Signed-off-by: David Goulet --- diff --git a/lttng-sessiond/ust-app.c b/lttng-sessiond/ust-app.c index b2c73ffed..72e3aeef2 100644 --- a/lttng-sessiond/ust-app.c +++ b/lttng-sessiond/ust-app.c @@ -859,10 +859,16 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock) struct lttng_ust_object_data *obj_event; struct lttng_ust_channel_attr uattr; + rcu_read_lock(); + + if (usess == NULL) { + DBG2("No UST session on global update. Returning"); + goto error; + } + DBG2("UST app global update for app sock %d for session uid %d", sock, usess->uid); - rcu_read_lock(); app = find_app_by_sock(sock); if (app == NULL) { ERR("Failed to update app sock %d", sock);