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 711457 - gvfs-info does not escape strings properly
gvfs-info does not escape strings properly
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-05 07:43 UTC by Ross Lagerwall
Modified: 2013-11-07 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
programs: Escape string properly (1.06 KB, patch)
2013-11-05 07:46 UTC, Ross Lagerwall
accepted-commit_now Details | Review

Description Ross Lagerwall 2013-11-05 07:43:44 UTC
Eg:

$ gvfs-info trash:///`echo -e "\x80\x81\x82\x83\x84\x85"`
display name: ??????
edit name: ??????
name: \xf0\xf1\xf2\xf3\xf4\xf5
type: regular
size:  3
uri: trash:///%80%81%82%83%84%85
attributes:
  standard::type: 1
  standard::name: \x80\x81\x82\x83\x84\x85

The "name:" row is incorrect.
Comment 1 Ross Lagerwall 2013-11-05 07:46:13 UTC
Created attachment 258983 [details] [review]
programs: Escape string properly

Use an unsigned char to avoid implementation-defined behavior of a right
shift.
Shift by 4 rather than 8 to get the second half of a byte.
Comment 2 Ondrej Holy 2013-11-07 14:46:18 UTC
Review of attachment 258983 [details] [review]:

It looks good.
Comment 3 Ross Lagerwall 2013-11-07 14:51:23 UTC
Pushed to master as d76dce9e83ddc033b53d2603b4f4d9f73de1f112. Thanks!