Skip to content

Commit a8a2683

Browse files
authored
Keep file when demux adds default platform (#2653)
If demux_sample returns (path, "windows") for a plain file (e.g. a csv named SAMPLE.XLS), tuple-based check saw (path, "") ≠ (path, "windows") and deleted the upload, triggering “Extracted file doesn’t exist”. Compare paths only.
1 parent 80c37f6 commit a8a2683

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cuckoo/core/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ def demux_sample_and_add_to_db(
15431543
# extract files from the (potential) archive
15441544
extracted_files, demux_error_msgs = demux_sample(file_path, package, options, platform=platform)
15451545
# check if len is 1 and the same file, if diff register file, and set parent
1546-
if extracted_files and (file_path, platform) not in extracted_files:
1546+
if extracted_files and not any(file_path == path for path, _ in extracted_files):
15471547
sample_parent_id = self.register_sample(File(file_path), source_url=source_url)
15481548
if conf.cuckoo.delete_archive:
15491549
path_delete(file_path.decode())

0 commit comments

Comments
 (0)