Changeset 428 for trunk/src/sh_static.c
- Timestamp:
- Mar 12, 2013, 9:42:07 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_static.c
r252 r428 76 76 77 77 #define PWD_BUFFER_SIZE 256 78 #define GRP_BUFFER_SIZE 256 78 #define GRP_BUFFER_SIZE 3584 79 #define GRP_BUFFER_SIZE_MALLOC 32768 79 80 80 81 /**********************************************************************/ … … 467 468 char **m; 468 469 struct group group; 469 char buff[PWD_BUFFER_SIZE]; 470 471 char * buff = malloc(GRP_BUFFER_SIZE_MALLOC); 470 472 471 473 rv = -1; … … 481 483 num_groups = 1; 482 484 483 while (!__pgsreader(__parsegrent, &group, buff, sizeof(buff), grf)) {485 while (!__pgsreader(__parsegrent, &group, buff, GRP_BUFFER_SIZE_MALLOC, grf)) { 484 486 assert(group.gr_mem); /* Must have at least a NULL terminator. */ 485 487 if (group.gr_gid != gid) { … … 511 513 * warnings from various malloc debuggers. */ 512 514 free(group_list); 515 free(buff); 513 516 return rv; 514 517 } … … 699 702 line_buff[line_len] = 0; 700 703 } else if (line_len + 2 == buflen) { /* line too long */ 704 rv = ERANGE; 705 break; 706 /* 701 707 ++skip; 702 708 continue; 709 */ 703 710 } 704 711
Note:
See TracChangeset
for help on using the changeset viewer.