提交 4f801bd6 编写于 作者: B Behdad Esfahbod

Mozilla bug 580233 - check for zero-length record in hb sanitizer.

Patch / report by Jonathan Kew.
上级 17e9ff93
......@@ -229,7 +229,7 @@ struct hb_sanitize_context_t
inline bool check_array (const void *base, unsigned int record_size, unsigned int len) const
{
const char *p = (const char *) base;
bool overflows = len >= ((unsigned int) -1) / record_size;
bool overflows = record_size > 0 && len >= ((unsigned int) -1) / record_size;
if (HB_DEBUG_SANITIZE && (int) this->debug_depth < (int) HB_DEBUG_SANITIZE)
fprintf (stderr, "SANITIZE(%p) %-*d-> array [%p..%p] (%d*%d=%ld bytes) in [%p..%p] -> %s\n", \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册