]> granicus.if.org Git - python/commitdiff
gcc doesn't realize that dummy is always initialized by the function call
authorGregory P. Smith <greg@krypto.org>
Sat, 23 Nov 2013 20:21:28 +0000 (20:21 +0000)
committerGregory P. Smith <greg@krypto.org>
Sat, 23 Nov 2013 20:21:28 +0000 (20:21 +0000)
and warns about potential uninitialized use.
Silence that by initializing it to null.

Modules/_pickle.c

index 4e0d86c69ccde4de4d82c4f69272458da83b5aa5..11e07b3902060c2b43423e56ff022449b72408dc 100644 (file)
@@ -1132,7 +1132,7 @@ _Unpickler_Read(UnpicklerObject *self, char **s, Py_ssize_t n)
         (self->frame_end_idx == -1 ||
          self->frame_end_idx <= self->next_read_idx)) {
         /* Need to read new frame */
-        char *dummy;
+        char *dummy = NULL;
         unsigned char *frame_start;
         size_t frame_len;
         if (_Unpickler_ReadUnframed(self, &dummy, FRAME_HEADER_SIZE) < 0)