-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intl: fix limit calculation #41026
intl: fix limit calculation #41026
Conversation
This is where I see that utf-16 may take 1 or 2 chars - https://en.wikipedia.org/wiki/UTF-16 @jasnell from history I can see you touched this code last and even though the code related to this was simply copied, maybe you have the best context to know if what I'm thinking from my look today makes sense? |
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com>
0f736b0
to
54f24fb
Compare
Landed in 98ec909 |
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41026 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41026 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41026 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41026 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: nodejs#41026 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Coverity reported that the use of sizeof along with pointer arithmetic was likely an error as the pointer arithmetic would already be accounting for the size of what the pointer points to. Looking at the code that looked right but removing the extra sizeOf caused tests to fail. Looking more closely it seems like we were not allocating a big enough buffer but the extra sizeof was allowing us to convert even though it might have been corrupting memory. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41026 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Coverity reported that the use of sizeof along with pointer
arithmetic was likely an error as the pointer arithmetic
would already be accounting for the size of what the
pointer points to.
Looking at the code that looked right but removing the
extra sizeOf caused tests to fail.
Looking more closely it seems like we were not allocating
a big enough buffer but the extra sizeof was allowing
us to convert even though it might have been corrupting
memory.
Signed-off-by: Michael Dawson mdawson@devrus.com