summaryrefslogtreecommitdiff
blob: d501d1b9dc4962d652af4ed1b949da6943357c96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
--- a/iodbcinst/inifile.c
+++ b/iodbcinst/inifile.c
@@ -1023,7 +1023,8 @@
 
   if (!_iodbcdm_cfg_find (pCfg, lpszSection, NULL))
     {
-      while (curr < cbRetBuffer && 0 == _iodbcdm_cfg_nextentry (pCfg))
+      while (curr < cbRetBuffer && 0 == _iodbcdm_cfg_nextentry (pCfg)
+	     && pCfg->section)
 	{
 	  if (_iodbcdm_cfg_section (pCfg))
 	    break;