From: Dan L. <da...@ob...> - 2010-07-22 02:58:31
|
On 07/13/10 19:20, Andrew Boyer: > It appears that get_dev_names_cam() in os_freebsd.cpp does not correctly handle cases in which more than 26 devices are detected > - mp = (char **)calloc(MAX_NUM_DEV, sizeof(char*)); ... > + mp = (char **)calloc(4 * MAX_NUM_DEV, sizeof(char*)); ... > - for (i = 0; i< ccb.cdm.num_matches&& n< MAX_NUM_DEV; i++) { ... > + for (i = 0; i< ccb.cdm.num_matches&& n< 4 * MAX_NUM_DEV; i++) { It's still dirty hack with ad-hoc hardcoded constant. The much better way is to (re)allocate the size of mp as needed. Dan |