Ignore:
Timestamp:
May 15, 2009, 4:56:31 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • Use new libmr.a in build process
  • Use mr_strcat to fix a memory allocation bug when mountlist contains lots of references unavailable at restore time, creating a error when memory is statically allocated (more usage is expected now).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-string.c

    r2190 r2209  
    625625    assert(flaws_str != NULL);
    626626
    627     flaws_str_A[0] = flaws_str_B[0] = flaws_str_C[0] = '\0';
    628 
    629 
    630627    if (!res && !strlen(flaws_str)) {
    631628        return (TRUE);
    632629    }
    633630    if (strlen(flaws_str) > 0) {
    634         sprintf(flaws_str_A, "%s", flaws_str + 1);
     631        paranoid_free(flaws_str_A);
     632        asprintf(&flaws_str_A, "%s", flaws_str + 1);
    635633    }
    636634    if (strlen(flaws_str_A) >= 74) {
    637635        for (i = 74; flaws_str_A[i] != ' '; i--);
    638         strcpy(flaws_str_B, flaws_str_A + i + 1);
     636        paranoid_free(flaws_str_B);
     637        asprintf(&flaws_str_B, "%s", flaws_str_A + i + 1);
    639638        flaws_str_A[i] = '\0';
    640639    }
    641640    if (strlen(flaws_str_B) >= 74) {
    642641        for (i = 74; flaws_str_B[i] != ' '; i--);
    643         strcpy(flaws_str_C, flaws_str_B + i + 1);
     642        paranoid_free(flaws_str_C);
     643        asprintf(&flaws_str_C, "%s", flaws_str_B + i + 1);
    644644        flaws_str_B[i] = '\0';
    645645    }
Note: See TracChangeset for help on using the changeset viewer.