This patch fixes a bad stop condition when decoding a protocol buffer variable integer
whose maximum lenghts are 10, shifting a uint64_t value by more than 63.
Thank you to Ilya for having reported this issue.
Must be backported to 2.1 and 2.0.
shift += 7;
/* The maximum length in bytes of a 64-bit encoded value is 10. */
- if (shift > 70)
+ if (shift > 63)
return 0;
}
shift += 7;
/* The maximum length in bytes of a 64-bit encoded value is 10. */
- if (shift > 70)
+ if (shift > 63)
return 0;
}
shift += 7;
/* The maximum length in bytes of a 64-bit encoded value is 10. */
- if (shift > 70)
+ if (shift > 63)
return 0;
}
shift += 7;
/* The maximum length in bytes of a 64-bit encoded value is 10. */
- if (shift > 70)
+ if (shift > 63)
return -1;
}