Skip to content

Commit ca408ce

Browse files
committed
CMD: replaces buffer size 1 in patch record by value derived from stack layout
1 parent e1720c5 commit ca408ce

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

chb/app/CHVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
chbversion: str = "0.3.0-20260126"
1+
chbversion: str = "0.3.0-20260218"
22

33
minimum_required_chb_version = "0.6.0_20260122"

chb/cmdline/reportcmds.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ------------------------------------------------------------------------------
66
# The MIT License (MIT)
77
#
8-
# Copyright (c) 2021-2025 Aarno Labs, LLC
8+
# Copyright (c) 2021-2026 Aarno Labs, LLC
99
#
1010
# Permission is hereby granted, free of charge, to any person obtaining a copy
1111
# of this software and associated documentation files (the "Software"), to deal
@@ -1316,15 +1316,30 @@ def include_target(target: 'CallTarget') -> bool:
13161316
buffersize = stackframe.stackoffset_gap(dstoffset)
13171317
if buffersize is None:
13181318
chklogger.logger.warning(
1319-
"Stackbuffer for %s at offset %s does not have a size and no upperbound either",
1319+
"Stackbuffer for %s at offset %s does not have a size and "
1320+
+ "no upperbound either",
13201321
str(instr), str(dstoffset))
13211322
continue
13221323
else:
13231324
chklogger.logger.warning(
1324-
"Stackbuffer for %s at offset %s does not have a size, but stackframe "
1325-
+ " allows a buffer of %s",
1325+
"Stackbuffer for %s at offset %s does not have a size, "
1326+
+ "but stackframe allows a buffer of %s",
13261327
str(instr), str(dstoffset), str(buffersize))
13271328
sizeorigin = "stackframe-layout"
1329+
elif buffersize == 1:
1330+
buffersize = stackframe.stackoffset_gap(dstoffset)
1331+
if buffersize is None:
1332+
chklogger.logger.warning(
1333+
"Stackbuffer size for %s at offset %s is reported to be 1 "
1334+
+ " and no buffer size could be derived from the stacklayout",
1335+
str(instr), str(dstoffset))
1336+
continue
1337+
else:
1338+
chklogger.logger.warning(
1339+
"Stackbuffer size for %s at offset %s is reported to be 1 "
1340+
+ "; replacing it by the size derived from the stacklayout",
1341+
str(instr), str(dstoffset))
1342+
sizeorigin = "stackframe-layout"
13281343
else:
13291344
sizeorigin = "stackslot-access"
13301345

0 commit comments

Comments
 (0)