Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

The reply of DLMessageGetFreeDiskSpace may be an overflowed value when idevicebackup2.

#321

I found the codes to generate the reply for DLMessageGetFreeDiskSpace within idevicebackup2.c may cause problem:

uint64_t freespace = 0;
...
uint64_t freespace = fs.f_bavail * fs.f_bsize;

On some 32-bit platforms, which lacks __USE_FILE_OFFSET64, statvfs::f_bavail and statvfs::f_bsize may be both 32-bit wide, which may cause compiler to use 32-bit version of multiplication, and give a 32-bit, usually overflowed product. On these platforms, including cygwin, idevicebackup2 may reply an value suggesting that free disk space be exhausted, and refuse proceeding backup, even if the true free disk space is far from being used up.

I used this trick to fix the problem:

uint64_t freespace = 0;
...
uint64_t freespace = (uint64_t)1 * fs.f_bavail * fs.f_bsize;
as the attached diff.

Reported by persmule · March 12th, 2013 @ 02:18 PM

State: resolved
Milestone: 1.2.0 Release
Assigned to: Martin S. Martin S.

Activity

  1. Martin S.
    Martin S.
    • State changed from new to resolved
    • Tag set to idevicebackup2, overflow
    • Assigned user set to Martin S.
    • Milestone set to 1.2.0 Release

    Thanks, fixed in git master.

    March 18th, 2013 @ 03:56 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.