Skip to content

Binwalk v3.1.1 crashes when encountering file names that contain non-UTF-8 characters or spaces. #870

@QudaRulo

Description

@QudaRulo

environment

tested on windows 10 22H2 19045.5854 wsl2 ubuntu 5.15.167.4-microsoft-standard-WSL2 22.04 and 6.8.0-45-generic ubuntu 22.04.1 x86_64.

When using binwalk v3.1.1 to extract the attachment, it work well on wsl2, but crashed on ubuntu physical machine.

testing

wsl2

.
├── TLAP303IV1.0升级软件.zip -> /to/path/to/TLAP303IV1.0升级软件.zip
└── TLAP303IV1.0升级软件.zip.extracted
    └── 0
        └── TL-AP303I-PoE V1.0�������20161017
            ├── TL-AP303I-PoEv1.bin
            ├── TL-AP303I-PoEv1.bin.extracted
            │   ├── 9D3F
            │   │   └── decompressed.bin
            │   └── C7E1F
            │       └── squashfs-root
            │           ├── bin
            │           ├── dev
            │           ├── etc
            │           ├── init -> bin/busybox
            │           ├── lib
            │           ├── linuxrc -> bin/busybox
            │           ├── mnt
            │           ├── proc
            │           ├── root
            │           ├── sbin
            │           ├── tmp
            │           ├── usr
            │           ├── var
            │           └── web
            └── TL-AP303I-PoE����˵��.mht

Although there are some strange characters.

ubuntu

$ binwalk -Me /the/path/to/TLAP303IV1.0升级软件.zip 

                                 /to/path/to/TLAP303IV1.0升级软件.zip
------------------------------------------------------------------------------------------------------------------------------------------------------------
DECIMAL                            HEXADECIMAL                        DESCRIPTION
------------------------------------------------------------------------------------------------------------------------------------------------------------
0                                  0x0                                ZIP archive, version: 2.0, file count: 2, total size: 5827757 bytes
------------------------------------------------------------------------------------------------------------------------------------------------------------
[+] Extraction of zip data at offset 0x0 completed successfully
------------------------------------------------------------------------------------------------------------------------------------------------------------

[2025-05-26T08:09:43Z ERROR binwalk::common] Failed to open file /the/path/to/TLAP303IV1.0升级软件.zip.extracted/0/TL-AP303I-PoE V1.0��������20161017/TL-AP303I-PoE����˵��.mht: No such file or directory (os error 2)
[2025-05-26T08:09:43Z ERROR binwalk] Failed to read /the/path/to/TLAP303IV1.0升级软件.zip.extracted/0/TL-AP303I-PoE V1.0��������20161017/TL-AP303I-PoE����˵��.mht data
[2025-05-26T08:09:43Z ERROR binwalk::common] Failed to open file /the/path/to/TLAP303IV1.0升级软件.zip.extracted/0/TL-AP303I-PoE V1.0��������20161017/TL-AP303I-PoEv1.bin: No such file or directory (os error 2)
[2025-05-26T08:09:43Z ERROR binwalk] Failed to read /the/path/to/TLAP303IV1.0升级软件.zip.extracted/0/TL-AP303I-PoE V1.0��������20161017/TL-AP303I-PoEv1.bin data
Analyzed 3 files for 110 file signatures (249 magic patterns) in 92.0 milliseconds

I'm not sure what happened — maybe it's related to UTF-8 encoding of strings in Rust.

TLAP303IV1.0升级软件.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions