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 dogbert2
Recipients dogbert2, steve.dower, tim.golden, zach.ware
Date 2015-04-02.22:11:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428012703.71.0.811050257631.issue23855@psf.upfronthosting.co.za>
In-reply-to
Content
Hello All,

   In reviewing code in Python-3.4.3/PC/_msi.c, I found a call to malloc() at line 326 in function 'static PyObject* msierror(int status)' in which the call is made and assigned to variable 'res', but no check for NULL, indicating failure is made afterwards.  The patch below corrects this issue:

--- _msi.c.orig 2015-04-02 15:01:02.882326352 -0700
+++ _msi.c      2015-04-02 15:02:43.382099357 -0700
@@ -324,6 +324,10 @@
     code = MsiRecordGetInteger(err, 1); /* XXX code */
     if (MsiFormatRecord(0, err, res, &size) == ERROR_MORE_DATA) {
         res = malloc(size+1);
+       if (res == NULL) /* malloc() failed, out of memory... */
+           PyErr_SetString(MSIError, "out of memory");
+           return NULL;
+       }
         MsiFormatRecord(0, err, res, &size);
         res[size]='\0';
     }
History
Date User Action Args
2015-04-02 22:11:43dogbert2setrecipients: + dogbert2, tim.golden, zach.ware, steve.dower
2015-04-02 22:11:43dogbert2setmessageid: <1428012703.71.0.811050257631.issue23855@psf.upfronthosting.co.za>
2015-04-02 22:11:43dogbert2linkissue23855 messages
2015-04-02 22:11:43dogbert2create