mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
Fix buffer overflow in sql error message buffer
Also use existing buffer when printing to stderr
This commit is contained in:

committed by
Jean-Michel Vourgère

parent
abcb273f2b
commit
1213f84859
@@ -51,13 +51,10 @@ mdb_sql_error(MdbSQL* sql, char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
vsnprintf(sql->error_msg, sizeof(sql->error_msg), fmt, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr,"\n");
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsprintf(sql->error_msg, fmt, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, "%s\n", sql->error_msg);
|
||||
}
|
||||
|
||||
int mdb_sql_yyinput(char *buf, int need)
|
||||
|
Reference in New Issue
Block a user