From 68e53ddcbad4ce4a2f44362411b6960c716b7e3e Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 20 Aug 2015 16:57:14 -0700 Subject: string_bytes: fix unaligned write in UCS2 Support unaligned output buffer when writing out UCS2 in `StringBytes::Write`. Fix: https://github.com/nodejs/node/issues/2457 PR-URL: https://github.com/nodejs/node/pull/2480 Reviewed-By: Trevor Norris --- src/string_bytes.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/string_bytes.h') diff --git a/src/string_bytes.h b/src/string_bytes.h index 2fcfedaa09..7c044ebaf5 100644 --- a/src/string_bytes.h +++ b/src/string_bytes.h @@ -151,6 +151,15 @@ class StringBytes { enum encoding encoding) { return Encode(v8::Isolate::GetCurrent(), buf, buflen, encoding); }) + + private: + static size_t WriteUCS2(char* buf, + size_t buflen, + size_t nbytes, + const char* data, + v8::Local str, + int flags, + size_t* chars_written); }; } // namespace node -- cgit v1.2.3