From 000b4ecba8f7c5cdb9be2f0377f0ac9bdc2ad210 Mon Sep 17 00:00:00 2001 From: Tim Landscheidt Date: Wed, 6 Jun 2012 16:49:26 +0200 Subject: [PATCH] 9th bit is overwritten. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Hour bit fields have 24 bits (0..23, 3 bytes). bit_nclear() however in this case is called to clear bits 0..24! Thus, it overwrites the first bit of the following struct member (dom). This is not problematic for normal use as dom is set after hour as are all other fields. The last field, dow, uses 8 bits so 9 are cleared. This could be the MIN_STAR bit of flags, but as flags is an int, there is probably a padding byte in between; at least I couldn't trigger it to be unset. So this could probably only cause problems on 8-bit systems. https://fedorahosted.org/cronie/ticket/11 Signed-off-by: Marcela Mašláňová --- src/entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entry.c b/src/entry.c index 5d377c6..8eff42a 100644 --- a/src/entry.c +++ b/src/entry.c @@ -407,7 +407,7 @@ get_list(bitstr_t * bits, int low, int high, const char *names[], */ /* clear the bit string, since the default is 'off'. */ - bit_nclear(bits, 0, (high - low + 1)); + bit_nclear(bits, 0, (high - low)); /* process all ranges */ -- 2.40.0