After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761582 - file-roller can not extract files with only one char in its name (a, b, c, 1, 2, 3 ... )
file-roller can not extract files with only one char in its name (a, b, c, 1,...
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: file-roller-maint
file-roller-maint
Depends on:
Blocks:
 
 
Reported: 2016-02-05 09:23 UTC by ZenWalker
Modified: 2016-05-08 10:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib-utils: fix single-character relative basenames (992 bytes, patch)
2016-05-01 18:46 UTC, Ernestas Kulik
none Details | Review
fix extracting files with single-character names (1.35 KB, patch)
2016-05-02 15:05 UTC, Ernestas Kulik
none Details | Review

Description ZenWalker 2016-02-05 09:23:45 UTC
I tested with drag and drop:

http://i.imgur.com/9E8CAZF.png

Ectraction not performed

(null)

This happens with files with one only char
Comment 1 Ernestas Kulik 2016-05-01 18:46:57 UTC
Created attachment 327116 [details] [review]
glib-utils: fix single-character relative basenames

_g_path_get_relative_basename() incorrectly checks the length of the
passed path against the length of the base directory for equality.

In the case the lengths match, path + base_dir_len will not be an
out-of-bounds read.
Comment 2 ZenWalker 2016-05-02 13:28:39 UTC
thanks

your patch dont works if the file is inside a folder
Comment 3 Ernestas Kulik 2016-05-02 14:08:18 UTC
Yes, it does.

Upload the archive you are testing it with, please.
Comment 4 Ernestas Kulik 2016-05-02 14:27:39 UTC
Okay, nevermind. It does not work if the file is deeper than the root.

Investigating now.
Comment 5 Ernestas Kulik 2016-05-02 15:05:16 UTC
Created attachment 327158 [details] [review]
fix extracting files with single-character names

Functions _g_path_get_relative_basename() and compute_base_path()
incorrectly check the length of the passed path against the length of
the base directory for equality.

In the case the lengths match, path + base_dir_len will not be an
out-of-bounds read.
Comment 6 ZenWalker 2016-05-02 17:16:35 UTC
ok, now works perfectly

thanks
Comment 7 Paolo Bacchilega 2016-05-08 10:23:32 UTC
(In reply to Ernestas Kulik from comment #5)
> Created attachment 327158 [details] [review] [review]
> fix extracting files with single-character names
> 
> Functions _g_path_get_relative_basename() and compute_base_path()
> incorrectly check the length of the passed path against the length of
> the base directory for equality.
> 
> In the case the lengths match, path + base_dir_len will not be an
> out-of-bounds read.

patch applied to the master branch, thank you.