This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Initialize all of datahead structure in nscd [BZ #16791]

Siddhesh Poyarekar <> 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]


	* 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>

Andreas Schwab,
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]