@@ -106,6 +106,8 @@ def __init__(self, mpstate):
106
106
self .add_command ('internalerror_autopilot' , self .cmd_internalerror_autopilot , "cause internal error in autopilot" )
107
107
self .add_command ('dfu_boot' , self .cmd_dfu_boot , "boot into DFU mode" )
108
108
self .add_command ('deadlock' , self .cmd_deadlock , "trigger deadlock" )
109
+ self .add_command ('nullptr_read' , self .cmd_nullptr_read , "read from a very low address" )
110
+ self .add_command ('nullptr_write' , self .cmd_nullptr_write , "write to a very low address" )
109
111
self .add_command ('batreset' , self .cmd_battery_reset , "reset battery remaining" )
110
112
self .add_command ('setorigin' , self .cmd_setorigin , "set global origin" )
111
113
self .add_command ('magsetfield' , self .cmd_magset_field , "set expected mag field by field" )
@@ -269,6 +271,14 @@ def cmd_deadlock(self, args):
269
271
'''trigger a mutex deadlock'''
270
272
self .cmd_dosomethingreallynastyto_autopilot (args , 'mutex-deadlock' , 100 )
271
273
274
+ def cmd_nullptr_write (self , args ):
275
+ '''write to a low address (nullptr-deref)'''
276
+ self .cmd_dosomethingreallynastyto_autopilot (args , 'nullptr-deref-write' , 102 )
277
+
278
+ def cmd_nullptr_read (self , args ):
279
+ '''read from a low address (nullptr-deref)'''
280
+ self .cmd_dosomethingreallynastyto_autopilot (args , 'nullptr-deref-read' , 103 )
281
+
272
282
def cmd_battery_reset (self , args ):
273
283
'''reset battery remaining'''
274
284
mask = - 1
0 commit comments