|
2022-01-12
| ||
| 21:40 | • Closed ticket [fba9c1fc12]: pointer arithmetic using NULL in PrintParse() pl... artifact: b9df89d053 user: jan.nijtmans | |
| 21:39 | Fix [fba9c1fc12]: pointer arithmetic using NULL in PrintParse() check-in: ac6ce2e3cf user: jan.nijtmans tags: core-8-6-branch | |
|
2021-12-29
| ||
| 00:27 | • New ticket [fba9c1fc12] pointer arithmetic using NULL in PrintParse(). artifact: 724048be43 user: chrstphrchvz | |
pointer arithmetic using NULL in PrintParse()
Closed / Fixedfba9c1fc1236944900ffcb4ac09ef7de44a98a6eCreated 5 years agoUpdated 5 years ago
Descriptionwiki2021-12-29 00:27:19
UBSan -fsanitize=pointer-overflow error during test parseExpr-1.1:
tcl/generic/tclTest.c:3623:46: runtime error: applying zero offset to null pointer
Using a ternary expression avoids the error:
diff --git generic/tclTest.c generic/tclTest.c
index 5774dfc16..203c2ca4b 100644
--- generic/tclTest.c
+++ generic/tclTest.c
@@ -3596,7 +3596,9 @@ PrintParse(
Tcl_NewIntObj(tokenPtr->numComponents));
}
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewStringObj(parsePtr->commandStart + parsePtr->commandSize,
+ Tcl_NewStringObj(parsePtr->commandStart
+ ? parsePtr->commandStart + parsePtr->commandSize
+ : NULL,
-1));
}
Referenced by1
ac6ce2e3cfFix [fba9c1fc12]: pointer arithmetic using NULL in PrintParse() check-in2022-01-12 21:39:40
jan.nijtmansplain2022-01-12 21:40:39
Fixed [ac6ce2e3cf279f02|here]. Thanks for the report!
Log in (anonymous is fine) to add a comment.