diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/krb5/asn.1/asn1buf.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/krb5/asn.1/asn1buf.c b/src/lib/krb5/asn.1/asn1buf.c index b8efabaca..71ad03b24 100644 --- a/src/lib/krb5/asn.1/asn1buf.c +++ b/src/lib/krb5/asn.1/asn1buf.c @@ -55,6 +55,12 @@ #include <stdio.h> #include "asn1_get.h" +#ifdef USE_VALGRIND +#include <valgrind/memcheck.h> +#else +#define VALGRIND_CHECK_READABLE(PTR,SIZE) ((void)0) +#endif + #if !defined(__GNUC__) || defined(CONFIG_SMALL) /* Declare private procedures as static if they're not used for inline expansion of other stuff elsewhere. */ @@ -181,6 +187,7 @@ asn1buf_insert_bytestring(asn1buf *buf, const unsigned int len, const void *sv) retval = asn1buf_ensure_space(buf,len); if (retval) return retval; + VALGRIND_CHECK_READABLE(sv, len); for (length=1; length<=len; length++,(buf->next)++) *(buf->next) = (s[len-length]); return 0; |