summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2002-07-30 11:40:57 (GMT)
committerThomas Heller <theller@ctypes.org>2002-07-30 11:40:57 (GMT)
commit3e1c18ad0c6057cd29a699595b73d4ad5d5c0a3a (patch)
treec62b18b02afaa9721a2b160e32f291201c36a966 /Python/marshal.c
parenta6255238b2a3501ec9c005e9e1d201ef4cffff77 (diff)
downloadcpython-3e1c18ad0c6057cd29a699595b73d4ad5d5c0a3a.zip
cpython-3e1c18ad0c6057cd29a699595b73d4ad5d5c0a3a.tar.gz
cpython-3e1c18ad0c6057cd29a699595b73d4ad5d5c0a3a.tar.bz2
Fix SF 588452: debug build crashes on marshal.dumps([128] * 1000).
See there for a description. Added test case. Bugfix candidate for 2.2.x, not sure about previous versions: probably low priority, because virtually no one runs debug builds.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 0df46cf..c00586d 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -84,17 +84,17 @@ w_string(char *s, int n, WFILE *p)
static void
w_short(int x, WFILE *p)
{
- w_byte( x & 0xff, p);
- w_byte((x>> 8) & 0xff, p);
+ w_byte((char)( x & 0xff), p);
+ w_byte((char)((x>> 8) & 0xff), p);
}
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);
+ 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);
}
#if SIZEOF_LONG > 4