提交 ffe6b1ec 编写于 作者: N Nicolas D

Merge pull request #35 from gladiac/master

Fix crash with crafted ini files.
......@@ -633,7 +633,7 @@ dictionary * iniparser_load(const char * ininame)
char line [ASCIILINESZ+1] ;
char section [ASCIILINESZ+1] ;
char key [ASCIILINESZ+1] ;
char tmp [ASCIILINESZ+1] ;
char tmp [(ASCIILINESZ * 2) + 1] ;
char val [ASCIILINESZ+1] ;
int last=0 ;
......@@ -699,7 +699,7 @@ dictionary * iniparser_load(const char * ininame)
break ;
case LINE_VALUE:
sprintf(tmp, "%s:%s", section, key);
snprintf(tmp, sizeof(tmp), "%s:%s", section, key);
errs = dictionary_set(dict, tmp, val) ;
break ;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册