From: Rudolf Polzer Date: Fri, 29 Apr 2011 11:59:28 +0000 (+0200) Subject: fix possible overrun X-Git-Tag: xonotic-v0.5.0~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c4fbf7a36539cc7e71d4fb6eea03229a53b35a97;p=xonotic%2Fd0_blind_id.git fix possible overrun --- diff --git a/d0_bignum-tommath.c b/d0_bignum-tommath.c index 966bd05..414d5af 100644 --- a/d0_bignum-tommath.c +++ b/d0_bignum-tommath.c @@ -177,7 +177,8 @@ ssize_t d0_bignum_export_unsigned(const d0_bignum_t *bignum, void *buf, size_t b memset(buf, 0, bufsize - count); buf += bufsize - count; } - mp_to_unsigned_bin_n(&bignum->z, buf, &count); + bufsize = count; + mp_to_unsigned_bin_n(&bignum->z, buf, &bufsize); if(bufsize > count) { // REALLY BAD