Ticket #36 (new bug)
Making the lib robust against bad (application) code
| Reported by: | elmom | Owned by: | pygi |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | libburn | Version: | TRUNK |
| Keywords: | Cc: |
Description
test/blank.c:
burn_drive_scan(&drives, &n_drives) // index>=*n_drives !!! blank_disc(drives[index].drive)
in blank_disc:
burn_drive_grab(drive, 1)
in burn_drive_grab:
if (!drive->released) {
burn_print(1, "can't grab - already grabbed\n");
return 0}
segfault!
That's quite trivial actually (and that would happen with about any function in libburn), but i'm sure there will be many not so easily recognizable points of failure in complex apps that will hopefully be made.
The real point from my part is that we should agree on the level of protection from bad code(both inside and outside libburn), i.e. the tradeof between being helpful to future debugging and having a hit on the speed and maintainability of the lib itself. I would be eager to submit patches improving the situation after the first examples about such improvements as I have no idea what would be the best way to do these things in c.
