This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author theller
Recipients
Date 2002-07-30.11:03:09
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 14:04:30adminlinkissue588452 messages
2007-08-23 14:04:30admincreate