[PATCH] - Fix wrong check in aux_syscalls.stp:_struct_sockaddr_u_impl (related to PR16718)
Robin Hack
rhack@redhat.com
Tue Mar 18 12:15:00 GMT 2014
Hi.
This small patch according to PR16718 fixes wrong check of STAP_ARG_len argument.
Have nice day
Robin Hack
-------------- next part --------------
commit 12d477cbc8e472a3c7820c3b276c5c535b0f2791
Author: Robin Hack <rhack@redhat.com>
Date: Tue Mar 18 13:11:41 2014 +0100
aux_syscalls: Fix STAP_ARG_len wrong check.
diff --git a/tapset/linux/aux_syscalls.stp b/tapset/linux/aux_syscalls.stp
index c99ef976d907391d328bf64ef0f6a574b5e2b8a5..107cde5366df45e784985a15e7071e0bd3e47de9 100644
--- a/tapset/linux/aux_syscalls.stp
+++ b/tapset/linux/aux_syscalls.stp
@@ -389,7 +389,7 @@ function _struct_sockaddr_u_impl:string(uaddr:long, len:long, what:long)
sa_dispatch what = (sa_dispatch)STAP_ARG_what;
char *ptr = (char *)(unsigned long)STAP_ARG_uaddr;
- size_t len = STAP_ARG_len < 128 ? STAP_ARG_len: 128;
+ size_t len = max(128, STAP_ARG_len);
struct sockaddr *sa = (struct sockaddr *)CONTEXT->buf;
char *stap_retvalue = (char *)(unsigned long)STAP_RETVALUE;
More information about the Systemtap
mailing list