]> granicus.if.org Git - cronie/commitdiff
9th bit is overwritten.
authorTim Landscheidt <tim@tim-landscheidt.de>
Wed, 6 Jun 2012 14:49:26 +0000 (16:49 +0200)
committerMarcela Mašláňová <mmaslano@redhat.com>
Wed, 6 Jun 2012 14:51:49 +0000 (16:51 +0200)
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á <mmaslano@redhat.com>
src/entry.c

index 5d377c6afd3185bec83db67f73cf031e53dd6b01..8eff42adbcb167b12c6786976467d20f2b7c9289 100644 (file)
@@ -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
         */