On Sat, Oct 03, 2015 at 09:38:10AM +0200, Anton Lundin wrote:
> On 02 October, 2015 - Linus Torvalds wrote:
>
> > Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the
> > problem when a "unsigned char" is shifted 24 bits left, and becomes a
> > "signed int". By casting the result to
On Oct 3, 2015 7:03 AM, "Dirk Hohndel" wrote:
>
> Which then means that the old code was actually correct and the fix and
> the fix of the fix were actually wrong?
Well, the final add (to convert from 2000-based numbers to 1970-based ones)
should still be done in timestamp_t.
On 03 October, 2015 - Anton Lundin wrote:
> On 02 October, 2015 - Linus Torvalds wrote:
>
> > Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the
> > problem when a "unsigned char" is shifted 24 bits left, and becomes a
> > "signed int". By casting the result to uint32_t, that
On Saturday 03 October 2015 09:38:10 Anton Lundin wrote:
> The root bug was mine. Another one of C's wonderful things that i didn't
> know about.
Yeah...
unsigned short us = 0x;
unsigned u = 0x;
us * us;// this is undefined behaviour
u *
On 02 October, 2015 - Linus Torvalds wrote:
> Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the
> problem when a "unsigned char" is shifted 24 bits left, and becomes a
> "signed int". By casting the result to uint32_t, that signed case won't
> happen.
>
The root bug was mine.
From: Linus Torvalds <torva...@linux-foundation.org>
Date: Fri, 2 Oct 2015 21:26:32 -0400
Subject: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling
Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the
problem when a "unsigned char" is shifted
> From: Linus Torvalds <torva...@linux-foundation.org>
> Date: Fri, 2 Oct 2015 21:26:32 -0400
> Subject: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling
>
> Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the
> problem when a "