Skip to content

Commit 9497df3

Browse files
author
Ole John Aske
committed
Bug#35180841 Remove requirement for md5_hash() input to be 8-byte aligned
Addendum patch to silence compiler warning caused by this patch, which is even treated as a compiler errors on some Pb2 targets - depending on build configs. Warning: Ndb.cpp:568:11: warning: ‘buf’ may be used uninitialized Fix is a require() which checks that md5_hash will not access 'buf' beyond its max size 'bufLen'. As require() is also a 'no return', compiler will realize that md5_hash() is never reached if reuired does not hold. Note that same pattern is also used for another similar md5_hash() call a few hundred lines further down. Change-Id: I54b47a0ed59f0926701dc860f1a66943281c0f9d
1 parent 41a0ddc commit 9497df3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

storage/ndb/src/ndbapi/Ndb.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ Ndb::computeHash(Uint32 *retval,
563563
}
564564
}
565565
len = Uint32(UintPtr(pos) - UintPtr(buf));
566+
assert((len & 3) == 0);
567+
require(len <= bufLen);
566568

567569
Uint32 values[4];
568570
md5_hash(values, (const char*)buf, len);

0 commit comments

Comments
 (0)