diff options
-rw-r--r-- | AuDispose.c | 4 | ||||
-rw-r--r-- | AuRead.c | 8 | ||||
-rw-r--r-- | configure.ac | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/AuDispose.c b/AuDispose.c index 355224d..b24d21c 100644 --- a/AuDispose.c +++ b/AuDispose.c @@ -38,7 +38,11 @@ XauDisposeAuth (Xauth *auth) free (auth->number); free (auth->name); if (auth->data) { +#ifdef HAVE_EXPLICIT_BZERO + (void) explicit_bzero (auth->data, auth->data_length); +#else (void) bzero (auth->data, auth->data_length); +#endif (void) free (auth->data); } free ((char *) auth); @@ -56,7 +56,11 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file) if (!data) return 0; if (fread (data, sizeof (char), len, file) != len) { +#ifdef HAVE_EXPLICIT_BZERO + explicit_bzero (data, len); +#else bzero (data, len); +#endif free (data); return 0; } @@ -97,7 +101,11 @@ XauReadAuth (FILE *auth_file) free (local.number); free (local.name); if (local.data) { +#ifdef HAVE_EXPLICIT_BZERO + explicit_bzero (local.data, local.data_length); +#else bzero (local.data, local.data_length); +#endif free (local.data); } return NULL; diff --git a/configure.ac b/configure.ac index cc38e7f..47316ce 100644 --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,7 @@ XORG_DEFAULT_OPTIONS AC_PROG_LN_S # Checks for library functions. -AC_CHECK_FUNCS([pathconf]) +AC_CHECK_FUNCS([explicit_bzero pathconf]) # Obtain compiler/linker options for depedencies PKG_CHECK_MODULES(XAU, xproto) |