From 4fa08cc50f38e23cd8608abe9da1476ea3d8d6a3 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 7 Jun 2013 16:19:23 -0400 Subject: [PATCH] PR15044: ucontext.stp: fix name == NULL bug on error The 'name' variable was not assigned a value if _stp_umod_lookup() failed. This means the call to strlcpy() happened even though 'name' was NULL. Now, name is always assigned a value, even if _stp_umod_lookup() fails. --- tapset/linux/ucontext.stp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tapset/linux/ucontext.stp b/tapset/linux/ucontext.stp index b2b045ee5..ba9c7d797 100644 --- a/tapset/linux/ucontext.stp +++ b/tapset/linux/ucontext.stp @@ -19,9 +19,8 @@ function umodname:string (addr:long) %{ const char *name = NULL; _stp_umod_lookup(STAP_ARG_addr, current, &name, NULL, NULL); if (!name) { -#if STAP_COMPAT_VERSION < STAP_VERSION(2,3) // PR15044 name = ""; -#else +#if STAP_COMPAT_VERSION >= STAP_VERSION(2,3) // PR15044 CONTEXT->last_error = "module cannot be found"; #endif } -- 2.43.5