WillAyd commented on code in PR #523:
URL: https://github.com/apache/arrow-nanoarrow/pull/523#discussion_r1638332238
##########
src/nanoarrow/nanoarrow_ipc_decoder_test.cc:
##########
@@ -252,7 +252,7 @@ TEST(NanoarrowIpcTest, NanoarrowIpcVerifyInvalid) {
memcpy(simple_schema_invalid, kSimpleSchema, i);
memcpy(simple_schema_invalid + i, kSimpleSchema + (i + 1),
- (sizeof(simple_schema_invalid) - i));
+ (sizeof(simple_schema_invalid) - i - 1));
Review Comment:
Fixes an off by one in the tests:
```sh
==980248==ERROR: AddressSanitizer: global-buffer-overflow on address
0x5622387a2880 at pc 0x7f1435c3a397 bp 0x7ffe37c04940 sp 0x7ffe37c040e8
READ of size 159 at 0x5622387a2880 thread T0
#0 0x7f1435c3a396 in __interceptor_memcpy
../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:827
#1 0x5622385468f4 in
NanoarrowIpcTest_StreamReaderInvalidBuffer_Test::TestBody()
../src/nanoarrow/nanoarrow_ipc_reader_test.cc:384
#2 0x56223869b6a1 in void
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,
void>(testing::Test*, void (testing::Test::*)(), char const*)
../subprojects/googletest-1.14.0/googletest/src/gtest.cc:2612
#3 0x5622386710d6 in void
testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,
void>(testing::Test*, void (testing::Test::*)(), char const*)
../subprojects/googletest-1.14.0/googletest/src/gtest.cc:2648
...
0x5622387a2880 is located 0 bytes to the right of global variable
'kSimpleRecordBatch' defined in
'../src/nanoarrow/nanoarrow_ipc_reader_test.cc:46:16' (0x5622387a27e0) of size
160
0x5622387a2880 is located 32 bytes to the left of global variable
'kEndOfStream' defined in '../src/nanoarrow/nanoarrow_ipc_reader_test.cc:60:16'
(0x5622387a28a0) of size 8
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]