From 08b523a194a066e1e758e12594d8e423b57460a9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 1 Dec 2011 03:18:30 +0100 Subject: [PATCH] MultibyteCodec_Decode() catchs PyUnicode_AS_UNICODE() failures --- Modules/cjkcodecs/multibytecodec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 1d6db9545ef..ded9188f071 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -643,6 +643,8 @@ MultibyteCodec_Decode(MultibyteCodecObject *self, if (buf.outobj == NULL) goto errorexit; buf.outbuf = PyUnicode_AS_UNICODE(buf.outobj); + if (buf.outbuf == NULL) + goto errorexit; buf.outbuf_end = buf.outbuf + PyUnicode_GET_SIZE(buf.outobj); if (self->codec->decinit != NULL &&