Re: [libvirt] [PATCH v2 1/3] conf: Properly truncate wide character names in virDomainObjGetShortName

2017-08-29 Thread Martin Kletzander
On Fri, Aug 25, 2017 at 06:03:15PM -0400, John Ferlan wrote: On 08/25/2017 07:21 AM, Martin Kletzander wrote: We always truncated the name at 20 bytes instead of characters. In case 20 bytes were in the middle of a multi-byte character, then the string became invalid and various parts of the

Re: [libvirt] [PATCH v2 1/3] conf: Properly truncate wide character names in virDomainObjGetShortName

2017-08-25 Thread John Ferlan
On 08/25/2017 07:21 AM, Martin Kletzander wrote: > We always truncated the name at 20 bytes instead of characters. In > case 20 bytes were in the middle of a multi-byte character, then the > string became invalid and various parts of the code would error > out (e.g. XML parsing of that string).

[libvirt] [PATCH v2 1/3] conf: Properly truncate wide character names in virDomainObjGetShortName

2017-08-25 Thread Martin Kletzander
We always truncated the name at 20 bytes instead of characters. In case 20 bytes were in the middle of a multi-byte character, then the string became invalid and various parts of the code would error out (e.g. XML parsing of that string). Let's instead properly truncate it after 20 characters ins