diff options
author | Alex Nelson <ajnelson@cs.ucsc.edu> | 2011-09-17 16:14:31 -0700 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-09-22 14:17:09 +0100 |
commit | 2a1279607c3982114ae931a6670bc36d2cb2ec1d (patch) | |
tree | f7e734b663999980451b6f9be54b71aa0b7938ef | |
parent | 0a28041f4156878a74543966f9a72ed3d214ba44 (diff) | |
download | hivex-2a1279607c3982114ae931a6670bc36d2cb2ec1d.tar.gz hivex-2a1279607c3982114ae931a6670bc36d2cb2ec1d.tar.xz hivex-2a1279607c3982114ae931a6670bc36d2cb2ec1d.zip |
hivexml: Do not print null input times
Dealing with "1601-01-01T00:00:00Z" is unnecessarily awkward, especially
since the value only represents a 0 found in the data.
Signed-off-by: Alex Nelson <ajnelson@cs.ucsc.edu>
-rw-r--r-- | xml/hivexml.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xml/hivexml.c b/xml/hivexml.c index cf11676..5030c24 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -169,6 +169,10 @@ main (int argc, char *argv[]) * fiwalk.cpp. * * The caller should free the returned buffer. + * + * This function returns NULL on a 0 input. In the context of + * hives, which only have mtimes, 0 will always be a complete + * absence of data. */ #define WINDOWS_TICK 10000000LL @@ -182,6 +186,9 @@ filetime_to_8601 (int64_t windows_ticks) time_t t; struct tm *tm; + if (windows_ticks == 0LL) + return NULL; + t = windows_ticks / WINDOWS_TICK - SEC_TO_UNIX_EPOCH; tm = gmtime (&t); if (tm == NULL) |