This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Initialize all of datahead structure in nscd [BZ #16791]
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: Mike Frysinger <vapier at gentoo dot org>, libc-alpha at sourceware dot org, Roland McGrath <roland at hack dot frob dot com>
- Date: Thu, 01 May 2014 22:01:30 +0200
- Subject: Re: [PATCH 2/2] Initialize all of datahead structure in nscd [BZ #16791]
- Authentication-results: sourceware.org; auth=none
- References: <20140401164104 dot GH16484 at spoyarek dot pnq dot redhat dot com> <24966439 dot irburZmzZi at vapier> <20140402094011 dot GD23931 at spoyarek dot pnq dot redhat dot com> <2541735 dot 7QtA0LDnTJ at vapier> <20140403150921 dot GA5063 at spoyarek dot pnq dot redhat dot com>
Siddhesh Poyarekar <siddhesh@redhat.com> writes:
> diff --git a/nscd/nscd-client.h b/nscd/nscd-client.h
> index c069bf6..ee16df6 100644
> --- a/nscd/nscd-client.h
> +++ b/nscd/nscd-client.h
> @@ -240,12 +240,17 @@ static inline time_t
> datahead_init_common (struct datahead *head, nscd_ssize_t allocsize,
> nscd_ssize_t recsize, uint32_t ttl)
> {
> + /* Initialize so that we don't write out junk in uninitialized data to the
> + cache. */
> + memset (head, 0, sizeof (*head));
nscd-client.h: In function âdatahead_init_commonâ:
nscd-client.h:245:3: warning: implicit declaration of function âmemsetâ [-Wimplicit-function-declaration]
memset (head, 0, sizeof (*head));
^
nscd-client.h:245:3: warning: incompatible implicit declaration of built-in function âmemsetâ [enabled by default]
Andreas.
* nscd/nscd-client.h: Include <string.h>.
diff --git a/nscd/nscd-client.h b/nscd/nscd-client.h
index ee16df6..cabba49 100644
--- a/nscd/nscd-client.h
+++ b/nscd/nscd-client.h
@@ -24,6 +24,7 @@
#include <stdbool.h>
#include <stdint.h>
+#include <string.h>
#include <sys/types.h>
#include <atomic.h>
#include <nscd-types.h>
--
1.9.2
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."