##// END OF EJS Templates
parsers: fix some signed comparison issues...
Matt Mackall -
r10449:7c8266c1 default
parent child Browse files
Show More
@@ -194,7 +194,7 b' static PyObject *parse_dirstate(PyObject'
194 mtime = ntohl(*(uint32_t *)(decode + 8));
194 mtime = ntohl(*(uint32_t *)(decode + 8));
195 flen = ntohl(*(uint32_t *)(decode + 12));
195 flen = ntohl(*(uint32_t *)(decode + 12));
196 cur += 17;
196 cur += 17;
197 if (flen > end - cur) {
197 if (cur + flen > end || cur + flen < cur) {
198 PyErr_SetString(PyExc_ValueError, "overflow in dirstate");
198 PyErr_SetString(PyExc_ValueError, "overflow in dirstate");
199 goto quit;
199 goto quit;
200 }
200 }
@@ -332,7 +332,7 b' static int _parse_index_ng (const char *'
332
332
333 n++;
333 n++;
334 step = 64 + (inlined ? comp_len : 0);
334 step = 64 + (inlined ? comp_len : 0);
335 if (end - data < step)
335 if (data + step > end || data + step < data)
336 break;
336 break;
337 data += step;
337 data += step;
338 }
338 }
General Comments 0
You need to be logged in to leave comments. Login now