fix(rizin): enforce UTF-8 recent output byte limit (#6314)
This commit is contained in:
1 parent
b9ca37b51f
commit
e28c11f87d
2 files changed
+21
-1
No files matched your search
@@ -1605,7 +1605,7 @@ const waitForCommandFrames = async (
|
||||
}
|
||||
};
|
||||
|
||||
const truncateUtf8 = (value: string, maximumBytes: number): string => {
|
||||
export const truncateUtf8 = (value: string, maximumBytes: number): string => {
|
||||
if (maximumBytes <= 0) return "";
|
||||
// A UTF-16 code unit needs at most three UTF-8 bytes. Buffer.write stops
|
||||
// before a partial character; only decode bytes it actually initialized.
|
||||
|
||||
Reference in new issue
Block a user