You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
M.warn ~category:(Behavior behavior) ~tags:[CWE cwe_number] "Size of lval dereference expression is %a (in bytes). It is offset by %a (in bytes). Memory out-of-bounds access must occur"ID.pretty casted_es ID.pretty casted_offs);
let casted_ao =ID.cast_to ~kind:Internal (Cilfacade.ptrdiff_ikind ()) ao in(* TODO: proper castkind *)
347
347
let ptr_size_lt_offs =ID.lt casted_ps casted_ao in
348
-
beginmatchID.to_bool ptr_size_lt_offs with
348
+
beginmatch ptr_size_lt_offs with
349
349
|Sometrue ->
350
350
set_mem_safety_flag InvalidDeref;
351
351
M.warn ~category:(Behavior behavior) ~tags:[CWE cwe_number] "Size of pointer is %a (in bytes). It is offset by %a (in bytes) due to pointer arithmetic. Memory out-of-bounds access must occur"ID.pretty casted_ps ID.pretty casted_ao;
let casted_o =ID.cast_to ~kind:Internal (Cilfacade.ptrdiff_ikind ()) o in(* TODO: proper castkind *)
435
435
let ptr_size_lt_offs =ID.lt casted_ps casted_o in
436
-
beginmatchID.to_bool ptr_size_lt_offs with
436
+
beginmatch ptr_size_lt_offs with
437
437
|Sometrue ->
438
438
set_mem_safety_flag InvalidDeref;
439
439
M.warn ~category:(Behavior behavior) ~tags:[CWE cwe_number] "Size of pointer in expression %a is %a (in bytes). It is offset by %a (in bytes). Memory out-of-bounds access must occur" d_exp binopexp ID.pretty casted_ps ID.pretty casted_o;
@@ -479,7 +479,7 @@ struct
479
479
let casted_en =ID.cast_to ~kind:Internal (Cilfacade.ptrdiff_ikind ()) en in(* TODO: proper castkind *)
let dest_size_lt_count =ID.lt casted_ds (ID.add casted_en casted_ao) in
482
-
beginmatchID.to_bool dest_size_lt_count with
482
+
beginmatch dest_size_lt_count with
483
483
|Sometrue ->
484
484
set_mem_safety_flag InvalidDeref;
485
485
M.warn ~category:(Behavior behavior) ~tags:[CWE cwe_number] "Size of %a in function %s is %a (in bytes) with an address offset of %a (in bytes). Count is %a (in bytes). Memory out-of-bounds access must occur" d_exp ptr fun_name ID.pretty casted_ds ID.pretty casted_ao ID.pretty casted_en;
0 commit comments