SFV checker file name bug

Bug #1815377 reported by valdikss
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DC++
Fix Released
Medium
Unassigned

Bug Description

SFV checker code contains a bug: the file name inside SFV file is searched by substring and no check for end of line is performed.

Example:
The folder with the following files:

the.fp.2011.limited.1080p.bluray.x264-psychd.sub
the.fp.2011.limited.1080p.bluray.x264-psychd.subs.sfv

SFV file contains:

the.fp.2011.limited.1080p.bluray.x264-psychd.subs.rar 18239c0b

Expected result:
No CRC32 record for "the.fp.2011.limited.1080p.bluray.x264-psychd.sub" is found inside SFV file.

Actual result:
dcpp/SFVReader.cpp SFVReader::tryFile opens SFV file, finds "the.fp.2011.limited.1080p.bluray.x264-psychd.sub" substring and tries to convert hex string of "s.rar 18" (instead of "18239c0b") to hex value with sscanf.
the.fp.2011.limited.1080p.bluray.x264-psychd.sub is not added to share because of incorrect CRC32.

Tags: sfv
Revision history for this message
eMTee (realprogger) wrote :

There were numerous reports over the years of files being left out of share in situations similar to what's described here and this seems to be the most probable reason of those "randomly" skipped files in folders containing an .sfv file.
Thanks for taking care of reporting it.

Changed in dcplusplus:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
valdikss (valdikss1) wrote :

Should I make a code fix and send a patch, or will you fix it yourself? EiskaltDC++ is waiting for upstream code fix in DC++.

Revision history for this message
eMTee (realprogger) wrote :

You're always welcome to create a patch. I think these days that'd be the fastest solution for yourself especially if you still keep using DC++ code as upstream.

eMTee (realprogger)
Changed in dcplusplus:
status: Confirmed → Fix Committed
Revision history for this message
eMTee (realprogger) wrote :

Fixed in DC++ 0.870.

Changed in dcplusplus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.