##// END OF EJS Templates
revlog: properly detect corrupted revlog in `index_get_length`...
Boris Feld -
r40772:95913063 default
parent child Browse files
Show More
@@ -242,7 +242,14 b' static inline int index_get_length(index'
242 return (int)ret;
242 return (int)ret;
243 } else {
243 } else {
244 const char *data = index_deref(self, rev);
244 const char *data = index_deref(self, rev);
245 return (int)getbe32(data + 8);
245 int tmp = (int)getbe32(data + 8);
246 if (tmp < 0) {
247 PyErr_Format(PyExc_OverflowError,
248 "revlog entry size out of bound (%d)",
249 tmp);
250 return -1;
251 }
252 return tmp;
246 }
253 }
247 }
254 }
248
255
General Comments 0
You need to be logged in to leave comments. Login now