]> sourceware.org Git - systemtap.git/commitdiff
PR15044: ucontext.stp: fix name == NULL bug on error
authorJonathan Lebon <jlebon@redhat.com>
Fri, 7 Jun 2013 20:19:23 +0000 (16:19 -0400)
committerJonathan Lebon <jlebon@redhat.com>
Mon, 10 Jun 2013 17:15:58 +0000 (13:15 -0400)
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

index b2b045ee505512618780b7f5e2d92cf0957669e1..ba9c7d7970326cdfd906667f651c500160cd6b10 100644 (file)
@@ -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 = "<unknown>";
-#else
+#if STAP_COMPAT_VERSION >= STAP_VERSION(2,3) // PR15044
     CONTEXT->last_error = "module cannot be found";
 #endif
   }
This page took 0.031252 seconds and 5 git commands to generate.