From 8e7c469f8247c02196fc366f6023231d276b2319 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 12 Jan 2016 10:17:32 +0100 Subject: [PATCH] fix possible buffer overrun in the errmsg string --- ext/interbase/interbase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 21a0243b43..3dfdac326f 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -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)); } -- 2.40.0