From da18bd643a55f9e5d8ae74a7e127d2cb03fafaae Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Tue, 26 Jul 2022 13:43:17 -0400 Subject: [PATCH] Do not allow UTIME_OMIT and UTIME_NOW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They should not be sent by qvm-copy, so do not allow them. Suggested-by: Marek Marczykowski-Górecki --- qrexec-lib/unpack.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/qrexec-lib/unpack.c b/qrexec-lib/unpack.c index a3402bc5..14a2f3e3 100644 --- a/qrexec-lib/unpack.c +++ b/qrexec-lib/unpack.c @@ -120,11 +120,7 @@ void send_status_and_crc(int code, const char *last_filename) { static long validate_utime_nsec(uint32_t untrusted_nsec) { enum { MAX_NSEC = 999999999L }; - _Static_assert(UTIME_NOW > MAX_NSEC && UTIME_NOW <= UINT32_MAX, "bad UTIME_NOW"); - _Static_assert(UTIME_OMIT > MAX_NSEC && UTIME_OMIT <= UINT32_MAX, "bad UTIME_OMIT"); - if (untrusted_nsec != UTIME_NOW && - untrusted_nsec != UTIME_OMIT && - untrusted_nsec > MAX_NSEC) + if (untrusted_nsec > MAX_NSEC) errx(1, "Invalid nanoseconds value %" PRIu32, untrusted_nsec); return (long)untrusted_nsec; }