Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:sschapiro:openstack:upstream
attr
attr-bz651119.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File attr-bz651119.patch of Package attr
From ca0d86ef0e4a0758f2532098d3b695608a96bed7 Mon Sep 17 00:00:00 2001 From: Kamil Dudka <kdudka@redhat.com> Date: Mon, 8 Nov 2010 10:17:02 -0500 Subject: [PATCH 1/3] getfattr: encode NULs properly with --encoding=text reported by Paul Bolle at https://bugzilla.redhat.com/650539 --- getfattr/getfattr.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/getfattr/getfattr.c b/getfattr/getfattr.c index cae9c3f..9c3de32 100644 --- a/getfattr/getfattr.c +++ b/getfattr/getfattr.c @@ -133,7 +133,7 @@ const char *encode(const char *value, size_t *size) size_t n, extra = 0; for (e=(char *)value; e < value + *size; e++) { - if (*e == '\n' || *e == '\r') + if (*e == '\0' || *e == '\n' || *e == '\r') extra += 4; else if (*e == '\\' || *e == '"') extra++; @@ -147,7 +147,9 @@ const char *encode(const char *value, size_t *size) e = encoded; *e++='"'; for (n = 0; n < *size; n++, value++) { - if (*value == '\n' || *value == '\r') { + if (*value == '\0' && n + 1 == *size) + break; + if (*value == '\0' || *value == '\n' || *value == '\r') { *e++ = '\\'; *e++ = '0' + ((unsigned char)*value >> 6); *e++ = '0' + (((unsigned char)*value & 070) >> 3); -- 1.7.4.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor