~pythonregexp2.7/python/issue2636-11

« back to all changes in this revision

Viewing changes to Modules/_struct.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-21 13:47:31 UTC
  • mfrom: (39021.1.404 Regexp-2.7)
  • mto: This revision was merged to the branch mainline in revision 39030.
  • Revision ID: darklord@timehorse.com-20080921134731-rudomuzeh1b2tz1y
Merged in changes from the latest python source snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1385
1385
                }
1386
1386
        }
1387
1387
 
 
1388
        /* check for overflow */
 
1389
        if ((len + 1) > (PY_SSIZE_T_MAX / sizeof(formatcode))) {
 
1390
                PyErr_NoMemory();
 
1391
                return -1;
 
1392
        }
 
1393
 
1388
1394
        self->s_size = size;
1389
1395
        self->s_len = len;
1390
1396
        codes = PyMem_MALLOC((len + 1) * sizeof(formatcode));