[PATCH] infinite loop during connection setup
Recently I encountered a bug when using tin with stunnel. When stunnel is running but the network is down (in my case WIFI was switched off) tin goes right after startup into an infinite loop: get_server() -> reconnect() -> nntp_open() -> server_init() -> get_respcode() -> get_only_respcode() -> tin_fgets() -> tin_read() -> get_server() -> reconnect() … Here is a basic setup to reproduce: stunnel.conf: | [nntp] | client = yes | accept = 127.0.0.1:1119 | connect = news.example.com:563 newsrctable: | 127.0.0.1 ~/.newsrcs alias .newsauth | 127.0.0.1 pass user Start stunnel, make sure network is down and start tin as follows: tin -p 1119 -A -g alias If tin was build without --enable-debug, it takes about 10 seconds until a Segmentation fault. Attached a patch with a possible fix. Dennis
participants (1)
-
Dennis Preiser