From: Jonathan Lebon Date: Fri, 7 Jun 2013 20:19:23 +0000 (-0400) Subject: PR15044: ucontext.stp: fix name == NULL bug on error X-Git-Tag: release-2.3~164 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4fa08cc50f38e23cd8608abe9da1476ea3d8d6a3;p=systemtap.git 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. --- 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 }