Ignore:
Timestamp:
May 14, 2009, 4:23:28 AM (15 years ago)
Author:
Bruno Cornec
Message:

-Improvements in tests for mountlist

  • escape remaining chars [{&...
File:
1 edited

Legend:

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

    r2205 r2206  
    673673
    674674        (void) truncate_to_drive_name(drive);
     675        log_msg(8, "drive truncated to %s", drive);
     676
    675677        for (j = 0;
    676678             j < noof_drives
    677679             && strcmp(drivelist->el[j].device, drive) != 0; j++) {
    678             paranoid_free(drive);
    679680            continue;
    680681        }
    681682        if (j == noof_drives) {
    682             strcpy(drivelist->el[noof_drives++].device, drive);
     683            strncpy(drivelist->el[noof_drives++].device, drive, 63);
    683684        }
    684685        paranoid_free(drive);
     
    817818        if (res < 5) {
    818819            /* no label found */
    819             asprintf(&tmp, "%s", "");
    820             mountlist->el[items].label = tmp;
     820            log_msg(4, "no label found for %s",mountlist->el[items].device);
     821            strcpy(mountlist->el[items].label,"");
    821822        }
    822823#elif __FreeBSD__
     
    826827               mountlist->el[items].mountpoint,
    827828               mountlist->el[items].format, siz);
    828         asprintf(&tmp, "%s", "");
    829         mountlist->el[items].label = tmp;
     829        strcpy(mountlist->el[items].label,"");
    830830#endif
    831831
     
    846846        if (mountlist->el[items].device[0] != '\0'
    847847            && mountlist->el[items].device[0] != '#') {
    848             if (items >= ARBITRARY_MAXIMUM) {
    849                 log_to_screen("Too many lines in mountlist.. ABORTING");
    850                 finish(1);
    851             }
    852848            for (j = 0;
    853849                 j < items
     
    884880                     mountlist->el[items].label);
    885881            items++;
     882            if (items >= MAX_MOUNTLIST_ENTRIES) {
     883                log_to_screen("Too many lines in mountlist.. ABORTING");
     884                finish(1);
     885            }
    886886        }
    887887        (void) fgets(incoming, MAX_STR_LEN - 1, fin);
Note: See TracChangeset for help on using the changeset viewer.