(unknown charset) [BLACKBOX] ZLib for BlackBox? Yes

From: (unknown charset) Oleg N. Cher <"Oleg>
Date: Mon, 27 Oct 2008 11:08:49 +0200

----boundary-LibPST-iamunique-621799696_-_-
Content-type: text/plain

Dear BlackBox Community,

Russian programmer Vladimir Sidorov has found and fix
two critical errors in current (and, how do I known, single)
ZLib realization in Oberon language, by Stefan Walthert.

Too, Vladimir Sidorov is author of BlackBox port of ZLib.
Thank you very much for your work, Vladimir!

1. Error in ZlibInflate.InflateCodes:

| CodeStart: (* try fast inflation while enough space available *)
IF (wavail >= 258) & (s.in.avail >= 10) THEN
InflateFast(s, wavail);
IF s.res.code # ZC.Ok THEN
IF s.res.code = ZC.StreamEnd THEN s.decode.state := CodeWash
ELSE s.decode.state := CodeBad
END
END;
EXIT
END;
s.decode.tree := s.decode.lltree;
s.decode.state := CodeLen

Must be fixed so:

| CodeStart: (* try fast inflation while enough space available *)
IF (wavail >= 258) & (s.in.avail >= 10) THEN
InflateFast(s, wavail);
IF s.res.code # ZC.Ok THEN
IF s.res.code = ZC.StreamEnd THEN s.decode.state := CodeWash
ELSE s.decode.state := CodeBad; EXIT
END
END
END;
IF s.decode.state # CodeWash THEN
s.decode.tree := s.decode.lltree;
s.decode.state := CodeLen
END

(This error is critical on data >32768 bytes)

2. Another error in ZlibInflate.NeedOut:

PROCEDURE NeedOut (VAR s: Stream; VAR wavail: INTEGER): BOOLEAN;
BEGIN
IF wavail = 0 THEN
IF (s.write = WindowSize) & (s.read # 0) THEN
s.write := 0; wavail := s.read - 1
END;
IF wavail = 0 THEN
Flush(s);
IF (s.write = WindowSize) & (s.read # 0) THEN
s.write := 0; wavail := s.read - 1
END;
IF wavail = 0 THEN
RETURN FALSE
END
END
END;
RETURN TRUE
END NeedOut;

Must be fixed so:

PROCEDURE NeedOut (VAR s: Stream; VAR wavail: INTEGER): BOOLEAN;
BEGIN
IF wavail = 0 THEN
IF (s.write = WindowSize) & (s.read # 0) THEN
s.write := 0; wavail := s.read - 1
END;
IF wavail = 0 THEN
Flush(s);
IF s.write < s.read THEN wavail := s.read - s.write - 1
ELSE wavail := WindowSize - s.write
END;
IF (s.write = WindowSize) & (s.read # 0) THEN
s.write := 0; wavail := s.read - 1
END;
IF wavail = 0 THEN
RETURN FALSE
END
END
END;
RETURN TRUE
END NeedOut;

(This error is too critical on data >32768 bytes)

This errors are present in Bluebottle (A2) too. Please, post
this information to Bluebottle developers.

Fixed version of ZLib was sent to Helmut Zinn for publishing
on his website http://www.zinnamturm.eu

--
Oleg N. Cher.
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-621799696_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTFcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIERlYXIgQmxhY2tCb3ggQ29tbXVuaXR5LFxwYXIN
ClxwYXINClJ1c3NpYW4gcHJvZ3JhbW1lciBWbGFkaW1pciBTaWRvcm92IGhhcyBmb3VuZCBhbmQg
Zml4XHBhcg0KdHdvIGNyaXRpY2FsIGVycm9ycyBpbiBjdXJyZW50IChhbmQsIGhvdyBkbyBJIGtu
b3duLCBzaW5nbGUpXHBhcg0KWkxpYiByZWFsaXphdGlvbiBpbiBPYmVyb24gbGFuZ3VhZ2UsIGJ5
IFN0ZWZhbiBXYWx0aGVydC5cc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yDQpGaXhlZCB2ZXJzaW9uIG9mIFpMaWIgd2FzIHNlbnQgdG8gSGVs
bXV0IFppbm4gZm9yIHB1Ymxpc2hpbmdccGFyDQpvbiBoaXMgd2Vic2l0ZSBodHRwOi8vd3d3Lnpp
bm5hbXR1cm0uZXVccGFyDQpccGFyDQotLVxwYXINCk9sZWcgTi4gQ2hlci5ccGFyDQpccGFyDQpc
cGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAi
U0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JFUk9OLkNIXHBhcg0KfQ==
----boundary-LibPST-iamunique-621799696_-_---
Received on Mon Oct 27 2008 - 10:08:49 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:52 UTC