Skip to content

Commit f5980b7

Browse files
committed
Buffer handling fixes
1 parent 29fb4ab commit f5980b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/interbase/interbase.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,8 @@ static char const dpb_args[] = {
861861

862862
int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db TSRMLS_DC)
863863
{
864-
short i, dpb_len, buf_len = 256;
865-
char dpb_buffer[256] = { isc_dpb_version1 }, *dpb;
864+
short i, dpb_len, buf_len = 257-2; /* version byte at the front, and a null at the end */
865+
char dpb_buffer[257] = { isc_dpb_version1, 0 }, *dpb;
866866

867867
dpb = dpb_buffer + 1;
868868

0 commit comments

Comments
 (0)