From e0f70c42bc156339d3018b1c6eff03a532266c5a Mon Sep 17 00:00:00 2001 From: Manuel Coenen Date: Wed, 20 Jan 2021 11:52:09 +0100 Subject: Fix nullptr access in LookupPinName --- src/Duet3Mini/Pins_Duet3Mini.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Duet3Mini') diff --git a/src/Duet3Mini/Pins_Duet3Mini.cpp b/src/Duet3Mini/Pins_Duet3Mini.cpp index 4acf87c2..500f8051 100644 --- a/src/Duet3Mini/Pins_Duet3Mini.cpp +++ b/src/Duet3Mini/Pins_Duet3Mini.cpp @@ -30,6 +30,10 @@ bool LookupPinName(const char *pn, LogicalPin &lpin, bool &hardwareInverted) noe for (size_t lp = 0; lp < ARRAY_SIZE(PinTable); ++lp) { const char *q = PinTable[lp].pinNames; + if (q == nullptr) + { + continue; + } while (*q != 0) { // Try the next alias in the list of names for this pin -- cgit v1.2.3