Message11749
Logged In: YES
user_id=11105
As I can see, the proper fix is to replace
static void
w_long(long x, WFILE *p)
{
w_byte((int)( x & 0xff), p);
w_byte((int)((x>> 8) & 0xff), p);
w_byte((int)((x>>16) & 0xff), p);
w_byte((int)((x>>24) & 0xff), p);
}
with
static void
w_long(long x, WFILE *p)
{
w_byte((char)( x & 0xff), p);
w_byte((char)((x>> 8) & 0xff), p);
w_byte((char)((x>>16) & 0xff), p);
w_byte((char)((x>>24) & 0xff), p);
}
and similar for the w_short() function.
Even safer would be to use the Py_SAFE_DOWNCAST
macro also in the w_byte macro.
Attached a patch for marshal.c. |
|
Date |
User |
Action |
Args |
2007-08-23 14:04:30 | admin | link | issue588452 messages |
2007-08-23 14:04:30 | admin | create | |
|