Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:sschapiro:openstack:upstream
bluez
bluez-try-utf8-harder.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bluez-try-utf8-harder.patch of Package bluez
diff --git a/src/security.c b/src/security.c index 905cf61..67fd266 100644 --- a/src/security.c +++ b/src/security.c @@ -705,8 +705,16 @@ static inline void remote_name_information(int dev, bdaddr_t *sba, void *ptr) memcpy(name, evt->name, MAX_NAME_LENGTH); /* It's ok to cast end between const and non-const since * we know it points to inside of name which is non-const */ - if (!g_utf8_validate(name, -1, (const char **) &end)) - *end = '\0'; + if (!g_utf8_validate(name, -1, (const char **) &end)) { + char *utf8_name; + + utf8_name = g_convert(name, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL); + if (utf8_name) { + memcpy(name, utf8_name, 248); + g_free(utf8_name); + } else + *end = '\0'; + } write_device_name(sba, &dba, name); }
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