[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New TextRider & oo2c patch



> --------
> 
> Btw: I did _not_ fix the potential string buffer overruns in ReadLReal
> and Scanner.ReadNum.

Go ahead and fix them.  It's probably an extremely unlikely situation
where a user will request a 1024 digit real or have a string longer
than 256 characters.

> --------
> 
> Second: A buglet in LRealStr
> 
> Converting 1E999 to LONGREAL does not result in an `outOfRange' error
> (see module below).
> 

The real problem was in the LRealConv module which was using a
low-level routine to form the double real and was silently clamping
the overflow to a valid value.  I've added some checking now to
LRealConv to catch these sorts of overflows.  The updated module
is attached.

Michael G.

begin 666 LRealConv.Mod.bz2
M0EIH.3%!62936<@J,FX`!@W_@'_P3D1=____/^??^W____]@$I[YSYQMWFN<
MS`:9;;5CMRMC=KS>SINPNS/>9P%3-RT-76:Z+SNNV/=M'*5UA)$2::I^29J>
M0FTFIZ'JIF9)M4VH_4-0R8FAY3TGZIZ0PC0S49`22`333030FFJGZ&E/4TTQ
M/4]31ZGII&@:8U!ZC30`!B`X:``&@T&@,$`-#33(!H:-,@!B!H`$@E(F@*;4
M]/5/29HC33T(`!H`#0`````!$DC2-3:AH-4U/R,C%3P1ZFIL2'I/2>2`:``'
MJ:!H,$B(0*;029J;4Q/4/4:9$PIY1O4AM$]0&@`-#3U-`:-JB/=BL8HO-#=#
MRO!T46(=V!+?LEK01M7R1]5+$FC]GP]Y@6H<_SEYA4-L:OW7[+KF[,^EJNVT
MFM?OK/]8\N)\*G^K0J#+'N+4*69[CYC25OO*C\K@>D>>,^(J8'4)CBH+=GGA
MWF4[^)X_!I+X][N?W,S+?U3Y'J]"D3IQG\E6KC"L'A$&FYVX5V$Y@>X9F?;9
M!ACG-2:`S#8PZ$(5O(E4PK3:VZG$49H:JM,#D'J&+&$<'A2;JS@<_--*JKVC
M>2$D=TJ26R@2P*#)GJJFT#J;O]#IRQ\CL[NLS`WF!G"$@2$40;54=26:A"RB
M#(H113?A+/D:H[#5[]U._U'U@OK-:[F.`B"T?0%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