提交 eeab356c 编写于 作者: K Kurt Roeckx

Don't call memcpy with NULL as source

Calling it with lenght 0 and NULL as source is undefined behaviour.
Reviewed-by: NRich Salz <rsalz@openssl.org>
GH: #2089
上级 1ea01427
......@@ -167,7 +167,8 @@ int bn_copy_words(BN_ULONG *out, const BIGNUM *in, int size)
return 0;
memset(out, 0, sizeof(*out) * size);
memcpy(out, in->d, sizeof(*out) * in->top);
if (in->d != NULL)
memcpy(out, in->d, sizeof(*out) * in->top);
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册