[PATCH nft] meta time: use uint64_t instead of time_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



time_t may be 32 bit on some platforms and thus can't fit a timestamp
with nanoseconds resolution. This causes overflows and ultimatively
breaks meta time expressions on such platforms.

Fix this by using uint64_t instead.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1567
Fixes: f8f32deda31df597614d9f1f64ffb0c0320f4d54 
("meta: Introduce new conditions 'time', 'day' and 'hour'")
Signed-off-by: Lukas Straub <lukasstraub2@xxxxxx>

Index: b/src/meta.c
===================================================================
--- a/src/meta.c
+++ b/src/meta.c
@@ -444,7 +444,7 @@ static struct error_record *date_type_pa
 					    struct expr **res)
 {
 	const char *endptr = sym->identifier;
-	time_t tstamp;
+	uint64_t tstamp;
 
 	if ((tstamp = parse_iso_date(sym->identifier)) != -1)
 		goto success;

Attachment: pgp_P_087kVlr.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux