https://bugs.winehq.org/show_bug.cgi?id=44550
Bug ID: 44550 Summary: ReactOS ftp.exe: enters endless loop on CTRL-Z Product: Wine Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: james_woodcock@yahoo.co.uk Distribution: ---
Created attachment 60509 --> https://bugs.winehq.org/attachment.cgi?id=60509 Proposed fix.
ReactOS ftp.exe uses gets() to get command line input. If the uses pushes CTRL-Z then it enters an endless loop.
Wine's gets() should handle EOF on STDIN in the same way as fgets() - it should return a string if any chars have been read into the buffer, or NULL if the buffer is empty.
I have attached a patch with a proposed fix. I also fixed getws() while I was at it.
https://bugs.winehq.org/show_bug.cgi?id=44550
--- Comment #1 from james_woodcock@yahoo.co.uk --- Created attachment 60510 --> https://bugs.winehq.org/attachment.cgi?id=60510 A simple test program
A simple test program to show this bug.
Compile the program, run "echo hello | wine ./getstest.exe" You will see an endless stream of "got string ||" on an unpatched copy of wine You will see "Success: EOF on STDIN detected" if the patch for this bug has been applied.
https://bugs.winehq.org/show_bug.cgi?id=44550
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase CC| |dark.shadow4@web.de Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #2 from Fabian Maurer dark.shadow4@web.de --- Confirming. Please consider sending the fix to wine-devel, only posting it on the bugtracker won't help much.
https://bugs.winehq.org/show_bug.cgi?id=44550
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com
--- Comment #3 from Piotr Caban piotr.caban@gmail.com --- The patch looks mostly good for me. In "nothing read" case output buffer should not be modified (the if should be before *buf = 0;). Could you please send the patch to wine-devel mailing list?
https://bugs.winehq.org/show_bug.cgi?id=44550
--- Comment #4 from james_woodcock@yahoo.co.uk --- I tidied up the patch as suggested and have sent it to wine-devel.
I suspect that it might have got stuck in a spam filter, so I'll try again tomorrow.
https://bugs.winehq.org/show_bug.cgi?id=44550
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |91c72ce7def5ccec3ea7f759111 | |b0d6fb96d722b Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #5 from Piotr Caban piotr.caban@gmail.com --- The patch got into wine. Marking as fixed.
https://bugs.winehq.org/show_bug.cgi?id=44550
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |3.2 CC| |focht@gmx.net
https://bugs.winehq.org/show_bug.cgi?id=44550
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.4.
https://bugs.winehq.org/show_bug.cgi?id=44550
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.0.x
https://bugs.winehq.org/show_bug.cgi?id=44550
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.0.x |---
--- Comment #7 from Michael Stefaniuc mstefani@winehq.org --- Removing the 3.0.x milestone from bugs included in 3.0.1.