[Libburn] patch preventing pointer error in libburn/sector.c

scdbackup at gmx.net scdbackup at gmx.net
Thu Dec 8 06:33:26 PST 2005


Hi,

attached is a small patch for a potential bug in
sector.c:get_bytes() (CVS version of today).

It would occur if  read(2)  returns -1 and no further
source is available in the link chain :

        valid = src->read(src, data, count);
        shortage = count - valid;
        ...
        if (shortage) {
                if (src->next) {
                        ...
                }
                memset(data + valid, 0, shortage);

This would copy count+1 zeros to address  data-1  (!).

The remedy is, of course, to set valid to 0 in this case.


Have a nice day :)

Thomas

-- 
10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A51208_patch_libburn_sector_get_bytes_underrun
Type: application/octet-stream
Size: 483 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/libburn/attachments/20051208/d99f777f/A51208_patch_libburn_sector_get_bytes_underrun.obj


More information about the libburn mailing list