You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
finfo::buffer(): Failed identify data 0:(null) #13344
I don't know the file format. The issue is the warning with the message "null".
Proposal 1: remove the warning, return false
Proposal 2: keep the warning, change (null) to a default message
Proposal 3: keep the warning, show an actual/useful message from the lib (only in this case, this ticket could be considered as a feature request for the lib).
It appears that the identification error without error code/message is just the bug of the library.
Otherwise, error code and message should be returned from the library, as the manpage says magic_buffer() returns NULL on error.
Activity
Girgias commentedon Feb 7, 2024
I'm confused, why do you expect "something instead of
null" here?What does this data represent and how should it determined?
Anyway, this looks more like a feature request for the underling libmagic library: https://www.darwinsys.com/file/ or https://bugs.astron.com/my_view_page.php
P2T commentedon Feb 7, 2024
I don't know the file format. The issue is the warning with the message "null".
Proposal 1: remove the warning, return false
Proposal 2: keep the warning, change (null) to a default message
Proposal 3: keep the warning, show an actual/useful message from the lib (only in this case, this ticket could be considered as a feature request for the lib).
ranvis commentedon Feb 8, 2024
@Girgias
The current libmagic (5.45) contains the update that fixes this case: file/file@029b824.
It appears that the identification error without error code/message is just the bug of the library.
Otherwise, error code and message should be returned from the library, as the manpage says
magic_buffer()returnsNULLon error.ndossche commentedon Feb 11, 2024
Thanks for figuring out the upstream commit.
I'll get it backported. Additionally, I prepared a PR to update 8.4-dev to libmagic 5.45.
Fix phpGH-13344: finfo::buffer(): Failed identify data 0:(null)
Fix GH-13344: finfo::buffer(): Failed identify data 0:(null)
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3'