issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Locked

Should we merge the changes of topic branch issue-#55 to master?

Yes
7
100%
No
0
No votes
Abstain
0
No votes
More discussion needed
0
No votes
 
Total votes: 7

User avatar
Josef Templ
Posts: 2048
Joined: Tue Sep 17, 2013 6:50 am

issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Post by Josef Templ »

This voting is about merging the changes of topic branch issue-#55
(DevPacker.RemoveWhiteSpaces loops at the end of the text) to master.
For the issue see http://redmine.blackboxframework.org/issues/55.
For the changes see http://redmine.blackboxframework.org/pr ... c03600dc32.

The changes are based on the proposal in CPC 1.7 rc5 and fix an endless loop
that appears when reading past the end of text in DevPacker.

Gentlemen, please cast your vote.

- Josef
Last edited by Josef Templ on Tue Jun 02, 2015 5:36 am, edited 1 time in total.
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Post by DGDanforth »

Code: Select all

WHILE ~rd.eot & (rd.Pos() <= end) & (rd.char <= 20X) DO GetCh(rd) END
Only if a valid previous call to GetCh has been done is this code valid. If not then the code should be
GetCh(rd);
WHILE ~rd.eot & (rd.Pos() <= end) & (rd.char <= 20X) DO GetCh(rd) END
User avatar
Josef Templ
Posts: 2048
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Post by Josef Templ »

As far as I see, "GetCh(rd);" is always called prior to RemoveWhiteSpaces.
rd always starts at PackThis, which starts with ParseExe, which starts with GetCh.
Thus, rd.eot should be well defined in all cases.
The suggested alternative solution would skip a character in many cases.

- Josef
Locked