Commit bc4fde46 bc4fde46c23c4d93268989306bb6b9689e0fe506 by Sergey Poznyakoff

Bugfixes

* imap4d/util.c (imap4d_getline): Do not report
ERR_NO_IFILE if an empty line is read.
* mailbox/msrv.c (server_section_parser): Catch
null tags.

Bugs reported by Simon Josefsson.
1 parent 3f69e162
...@@ -1375,19 +1375,17 @@ imap4d_getline (char **pbuf, size_t *psize, size_t *pnbytes) ...@@ -1375,19 +1375,17 @@ imap4d_getline (char **pbuf, size_t *psize, size_t *pnbytes)
1375 if (rc == 0) 1375 if (rc == 0)
1376 { 1376 {
1377 char *s = *pbuf; 1377 char *s = *pbuf;
1378 len = util_trim_nl (s, len); 1378
1379 if (imap4d_transcript)
1380 {
1381 if (len)
1382 mu_diag_output (MU_DIAG_DEBUG, "recv: %s", s);
1383 else
1384 mu_diag_output (MU_DIAG_DEBUG, "got EOF");
1385 }
1386 if (len == 0) 1379 if (len == 0)
1387 { 1380 {
1381 if (imap4d_transcript)
1382 mu_diag_output (MU_DIAG_DEBUG, "got EOF");
1388 imap4d_bye (ERR_NO_IFILE); 1383 imap4d_bye (ERR_NO_IFILE);
1389 /*FIXME rc = ECONNABORTED;*/ 1384 /*FIXME rc = ECONNABORTED;*/
1390 } 1385 }
1386 len = util_trim_nl (s, len);
1387 if (imap4d_transcript)
1388 mu_diag_output (MU_DIAG_DEBUG, "recv: %s", s);
1391 if (pnbytes) 1389 if (pnbytes)
1392 *pnbytes = len; 1390 *pnbytes = len;
1393 } 1391 }
......
...@@ -970,7 +970,7 @@ server_section_parser (enum mu_cfg_section_stage stage, ...@@ -970,7 +970,7 @@ server_section_parser (enum mu_cfg_section_stage stage,
970 { 970 {
971 case mu_cfg_section_start: 971 case mu_cfg_section_start:
972 { 972 {
973 if (node->label->type != MU_CFG_STRING) 973 if (node->label == NULL || node->label->type != MU_CFG_STRING)
974 return 1; 974 return 1;
975 /* FIXME: should not modify 2nd arg, or it should not be const */ 975 /* FIXME: should not modify 2nd arg, or it should not be const */
976 return server_block_begin (tree->debug, node->label->v.string, 976 return server_block_begin (tree->debug, node->label->v.string,
......