Bug in multiprecision division routine

v.das%ucla-locus at sri-unix.UUCP v.das%ucla-locus at sri-unix.UUCP
Fri Sep 16 06:13:08 AEST 1983


From:            David Smallberg <v.das at ucla-locus>

The routine s_div in /usr/src/lib/libmp/mout.c (under 4.1) accesses
uninitialized storage when the dividend is zero, often producing a bad result.
Line 113 currently reads
	if (qval[qlen-1]==0) qlen--;
It should read
	if (qlen > 0  &&  qval[qlen-1]==0) qlen--;



More information about the Comp.unix.wizards mailing list