From 3ad36973475e166cb488c98cca7e358dc79275a9 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 25 Feb 2010 01:47:30 +0000
Subject: [PATCH] Fix potential infinite (while connected) wait for ZEOF or
 ZFIN from sender in zmodem_recv_header_and_check(), a TIMEOUT (no input)
 would not stop the loop.

---
 src/sbbs3/zmodem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/zmodem.c b/src/sbbs3/zmodem.c
index 7027578765..3d000ebdc4 100644
--- a/src/sbbs3/zmodem.c
+++ b/src/sbbs3/zmodem.c
@@ -1291,7 +1291,7 @@ int zmodem_recv_header_and_check(zmodem_t* zm)
 	while(is_connected(zm) && !is_cancelled(zm)) {
 		type = zmodem_recv_header_raw(zm,TRUE);		
 
-		if(type != INVHDR && (type&BADSUBPKT) == 0) {
+		if(type != INVHDR && ((type&BADSUBPKT) == 0 || type==TIMEOUT)) {
 			break;
 		}
 
-- 
GitLab