From: Johannes Berg Date: Thu, 13 Feb 2020 20:28:04 +0000 (+0100) Subject: scan: wps: fix some misplaced code X-Git-Tag: v5.8~30 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fiw.git;a=commitdiff_plain;h=ff326369fb5561c8108f46cc003ea9cd4ef4d089 scan: wps: fix some misplaced code I added a length check, but neglected to move the actual data access after that ... fix that! Change-Id: I6cf3f396ce86c70df0d1f917b6a028de657ff2a7 Signed-off-by: Johannes Berg --- diff --git a/scan.c b/scan.c index 4dcdf0e..c784159 100644 --- a/scan.c +++ b/scan.c @@ -2011,13 +2011,14 @@ static void print_wifi_wps(const uint8_t type, uint8_t len, const uint8_t *data, break; } case 0x1057: { - __u8 val = data[4]; + __u8 val; tab_on_first(&first); if (sublen < 1) { printf("\t * AP setup locked: (invalid length %d)\n", sublen); break; } + val = data[4]; printf("\t * AP setup locked: 0x%.2x\n", val); break; }