Changeset 670 in MondoRescue


Ignore:
Timestamp:
Jun 11, 2006, 7:51:07 AM (18 years ago)
Author:
andree
Message:

Do the usual strcpy() and paranoid_free() after first asprintf() in
parse_mdstat() to avoid segmentation fault.

Location:
branches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0.8/mondo/mondo/common/libmondo-raid.c

    r576 r670  
    10421042    pos = string;
    10431043    while (*pos == ' ') *pos++;
    1044     asprintf(&string, pos);
    1045     //
     1044    asprintf(&strtmp, pos);
     1045    strcpy(string, strtmp);
     1046    paranoid_free(strtmp);
    10461047    // if we have newline after only spaces, this is a blank line, update
    10471048    // counters, otherwise do normal parsing
  • branches/stable/mondo/mondo/common/libmondo-raid.c

    r565 r670  
    10421042    pos = string;
    10431043    while (*pos == ' ') *pos++;
    1044     asprintf(&string, pos);
    1045     //
     1044    asprintf(&strtmp, pos);
     1045    strcpy(string, strtmp);
     1046    paranoid_free(strtmp);
    10461047    // if we have newline after only spaces, this is a blank line, update
    10471048    // counters, otherwise do normal parsing
Note: See TracChangeset for help on using the changeset viewer.