From 6412a9a89efd9aa2effb983d38b232f72323429c Mon Sep 17 00:00:00 2001 From: dongresource Date: Tue, 8 Feb 2022 12:48:58 +0100 Subject: [PATCH] Fix missing validation in Nanos::nanoEquipHandler() --- src/Nanos.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Nanos.cpp b/src/Nanos.cpp index 74a85c1..c6d4adf 100644 --- a/src/Nanos.cpp +++ b/src/Nanos.cpp @@ -226,6 +226,9 @@ static void nanoEquipHandler(CNSocket* sock, CNPacketData* data) { if (nano->iNanoSlotNum > 2 || nano->iNanoSlotNum < 0) return; + if (nano->iNanoID < 0 || nano->iNanoID >= NANO_COUNT) + return; + resp.iNanoID = nano->iNanoID; resp.iNanoSlotNum = nano->iNanoSlotNum;