Mercurial > dropbear
comparison common-session.c @ 1733:d529a52b2f7c coverity coverity
merge coverity from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 26 Jun 2020 21:07:34 +0800 |
parents | 3974f087d9c0 |
children | 3b9b427925a0 |
comparison
equal
deleted
inserted
replaced
1643:b59623a64678 | 1733:d529a52b2f7c |
---|---|
145 | 145 |
146 ses.chantypes = NULL; | 146 ses.chantypes = NULL; |
147 | 147 |
148 ses.allowprivport = 0; | 148 ses.allowprivport = 0; |
149 | 149 |
150 #if DROPBEAR_PLUGIN | |
151 ses.plugin_session = NULL; | |
152 #endif | |
153 | |
150 TRACE(("leave session_init")) | 154 TRACE(("leave session_init")) |
151 } | 155 } |
152 | 156 |
153 void session_loop(void(*loophandler)(void)) { | 157 void session_loop(void(*loophandler)(void)) { |
154 | 158 |
364 /* max length of 255 chars */ | 368 /* max length of 255 chars */ |
365 char linebuf[256]; | 369 char linebuf[256]; |
366 int len = 0; | 370 int len = 0; |
367 char done = 0; | 371 char done = 0; |
368 int i; | 372 int i; |
369 /* If they send more than 50 lines, something is wrong */ | 373 |
370 for (i = 0; i < 50; i++) { | 374 /* Servers may send other lines of data before sending the |
375 * version string, client must be able to process such lines. | |
376 * If they send more than 50 lines, something is wrong */ | |
377 for (i = IS_DROPBEAR_CLIENT ? 50 : 1; i > 0; i--) { | |
371 len = ident_readln(ses.sock_in, linebuf, sizeof(linebuf)); | 378 len = ident_readln(ses.sock_in, linebuf, sizeof(linebuf)); |
372 | 379 |
373 if (len < 0 && errno != EINTR) { | 380 if (len < 0 && errno != EINTR) { |
374 /* It failed */ | 381 /* It failed */ |
375 break; | 382 break; |