Merge remote-tracking branch 'origin/topic/jsiwek/gh-822-ubsan-ci'

* origin/topic/jsiwek/gh-822-ubsan-ci:
  Fix negative-value-left-shift undefined behavior in patricia trie
  Improve negation of ConstExpr
  Avoid signed integer overflow when combining SMB header PID bits
  Avoid unary negation of INT64_MIN in modp_litoa10
  Avoid double-to-int conversion overflows in modp_dtoa functions
  Fix divide-by-zero in Entropy analyzer
  Fix divide-by-zero in stats/profiling memory usage calculation
  Fix uninitialized field in POP3 fuzzer
  Add framework for running UndefinedBehaviorSanitizer in CI
This commit is contained in:
Jon Siwek 2020-09-24 08:16:45 -07:00
commit 8feca7291b
15 changed files with 256 additions and 86 deletions

View file

@ -39,6 +39,11 @@
%}
refine connection SMB_Conn += {
function join_pid_bits(hi: uint16, lo: uint16): uint32
%{
return (static_cast<uint32_t>(hi) << 16) | static_cast<uint32_t>(lo);
%}
function proc_smb_message(h: SMB_Header, is_orig: bool): bool
%{
if ( smb1_message )
@ -306,7 +311,7 @@ type SMB_Header(is_orig: bool) = record {
} &let {
err_status_type = (flags2 >> 14) & 1;
unicode = (flags2 >> 15) & 1;
pid = (pid_high * 0x10000) + pid_low;
pid: uint32 = $context.connection.join_pid_bits(pid_high, pid_low);
is_pipe: bool = $context.connection.get_tree_is_pipe(tid);
proc : bool = $context.connection.proc_smb_message(this, is_orig);
} &byteorder=littleendian;