Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 2572 - Multi-byte characters may corrupt Json from mod-script-pipe
Multi-byte characters may corrupt Json from mod-script-pipe
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Other
2.4.2
All All
: P3 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-25 20:50 UTC by Steve Daulton
Modified: 2021-02-05 15:24 UTC (History)
2 users (show)

See Also:
Steps To Reproduce:
1. Create a project with labels: 0.723214 0.723214 1 2.049107 2.517857 Учёба 3.629464 4.352679 3 2. From Python, send the command: GetInfo: Type="Labels" 3. Observe that the returned data is missing the last few characters of the second label: [ [ 1, [ [ 0.723214, 0.723214, "1" ], [ 2.04911, 2.51786, "Учёба [ 3.62946, 4.35268, "3" ] ] ] ]
Release Note:
mod-script-pipe: Json data returned from mod-script-pipe may be corrupt if the data contains multi-byte characters.
First Git SHA:
Group: ---
Workaround:
Avoid using multi-byte characters for labels or track names.
Closed: 2021-02-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2020-10-25 20:50:28 UTC
If labels contain multibyte UTF-8 characters, then the Json returned from GetInfo: Type="Labels" is corrupted.


The problem appears to be in ScripterCallback.cpp DoSrvMore
The number of characters to print is a count of Unicode characters, (and may be multi-byte), but the characters written to the pipe are single byte C string representations. Thus the number of characters that need to be written may be more than the number of characters counted.
Comment 1 Steve Daulton 2020-10-25 21:17:37 UTC
Fix committed:
https://github.com/audacity/audacity/commit/e7c010c
Comment 2 James Crook 2021-01-24 19:03:25 UTC
This fix loses characters from the output string.

[Tested on Windows]

It is miscounting the characters.

REOPENED.
Comment 4 James Crook 2021-02-05 15:24:56 UTC
Tested by Steve (on Linux).
RESOLVED FIXED