[MonetDB-users] Are these bugs?

hi all when i use c++ pragrm to insert some data into a table,the program crashes,the message is below: so i use gdb to debug the bug, i find that these places may be bugs: 1. out of bounds access file mapi.c function: mapi_param_store 2356 strncpy(hdl->query + k, p, q - p); 2357 k += q - p; 2358 hdl->query[k] = 0; q-p is equal or bigger than lim - k ,the strncpy will hava a out of bounds access. this may be the reason to crash. 2. out of bounds access file:mapi.c function: mapi_param_store 2411 case MAPI_DOUBLE: 2412 checkSpace(20); 2413 sprintf(hdl->query + k, "%.17g", *(double *) src); 2414 break; sprintf(hdl->query + k, "%.17g", *(double *) src) , sprintf function with "%.17g" format may produces a string longer than 20,eg: double d = 0.000200000000000001; double d = 0.000200000000000001; printf("%.17g",d); the result is : 0.00020000000000000101 so i think, in some paticular condition ,this will hava a out of bounds access too. I'm working with MonetDB Server v5.22.3, based on kernel 1.40.3 over fedora 12.

Thanks. I'll fix the sources. On 2011-03-09 05:14, tangray wrote:
hi all when i use c++ pragrm to insert some data into a table,the program crashes,the message is below:
so i use gdb to debug the bug, i find that these places may be bugs�� 1. out of bounds access file mapi.c function: mapi_param_store
2356 strncpy(hdl->query + k, p, q - p); 2357 k += q - p; 2358 hdl->query[k] = 0;
q-p is equal or bigger than lim - k ,the strncpy will hava a out of bounds access. this may be the reason to crash.
2. out of bounds access file:mapi.c function: mapi_param_store
2411 case MAPI_DOUBLE: 2412 checkSpace(20); 2413 sprintf(hdl->query + k, "%.17g", *(double *) src); 2414 break;
sprintf(hdl->query + k, "%.17g", *(double *) src) , sprintf function with "%.17g" format may produces a string longer than 20,eg��
double d = 0.000200000000000001; double d = 0.000200000000000001; printf("%.17g",d); the result is : 0.00020000000000000101 so i think, in some paticular condition ,this will hava a out of bounds access too.
I'm working with MonetDB Server v5.22.3, based on kernel 1.40.3 over fedora 12.
------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Sjoerd Mullender
participants (2)
-
Sjoerd Mullender
-
tangray