This PR fixes some potential/actual bugs identified by the undefined behaviour sanitizer.
Several of these became apparent with -Wextra, mainly through 'unused parameter' warnings, of which there are many.
String::replace: Passing nullptr to memcpy is undefined behaviour
axtls sha1: Undefined behaviour
axtls-8266/crypto/sha1.c:124:42: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior axtls-8266/crypto/sha1.c:124:42
Because: implicit conversion of uint8_t to int
Don't force queueCallback with no parameter
Sanitizer reports undefined behaviour passing parameter to function which doesn't expect one.
Works fine in practice but safer to add a lamba for dealing with it.
Stream::parseFloat() not handling timeout
String(unsigned char, ...) ignoring width, pad parameters
char could be signed, check for > 127 would never succeed
This PR fixes some potential/actual bugs identified by the undefined behaviour sanitizer. Several of these became apparent with
-Wextra
, mainly through 'unused parameter' warnings, of which there are many.String::replace: Passing nullptr to memcpy is undefined behaviour
axtls sha1: Undefined behaviour
axtls-8266/crypto/sha1.c:124:42: runtime error: left shift of 128 by 24 places cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior axtls-8266/crypto/sha1.c:124:42
Because: implicit conversion of uint8_t to int
Don't force queueCallback with no parameter
Sanitizer reports undefined behaviour passing parameter to function which doesn't expect one. Works fine in practice but safer to add a lamba for dealing with it.
Stream::parseFloat() not handling timeout
String(unsigned char, ...) ignoring width, pad parameters
char could be signed, check for
> 127
would never succeedHostTests datetime check should use parameter
Fix unimplemented host
RtcClass::setRtcNanoseconds()
Potential array bounds violation in esp-open-lwip dhcp.c
Check for index in range should be first.