fix possible buffer overrun in the errmsg string

This commit is contained in:
Anatol Belski 2016-01-12 10:17:32 +01:00
parent b54739e68d
commit 8e7c469f82

View File

@ -512,7 +512,7 @@ void _php_ibase_error(void) /* {{{ */
IBG(sql_code) = isc_sqlcode(IB_STATUS);
while ((s - IBG(errmsg)) < MAX_ERRMSG - (IBASE_MSGSIZE + 2) && fb_interpret(s, MAX_ERRMSG, &statusp)) {
while ((s - IBG(errmsg)) < MAX_ERRMSG - (IBASE_MSGSIZE + 2) && fb_interpret(s, MAX_ERRMSG - strlen(IBG(errmsg)) - 1, &statusp)) {
strcat(IBG(errmsg), " ");
s = IBG(errmsg) + strlen(IBG(errmsg));
}