Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | From 078e962d345fd0536fe7ba797485ee1a4159c032 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 4 Feb 2022 09:18:30 -0800 |
| 4 | Subject: [PATCH] Make alpha2 to be 3 characters long |
| 5 | |
| 6 | Fixes buffer overflow |
| 7 | reglib.c:969:9: error: 'sscanf' may overflow; destination buffer in argument 3 has size 2, but the corresponding specifier may require size 3 [-Werror,-Wfortify-source] |
| 8 | alpha2, |
| 9 | ^ |
| 10 | Upstream-Status: Pending |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
| 13 | reglib.c | 2 +- |
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/reglib.c b/reglib.c |
| 17 | index e00e9b8..8565a0b 100644 |
| 18 | --- a/reglib.c |
| 19 | +++ b/reglib.c |
| 20 | @@ -958,7 +958,7 @@ reglib_parse_rules(FILE *fp, struct ieee80211_regdomain *trd) |
| 21 | static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd) |
| 22 | { |
| 23 | char dfs_region_alpha[9]; |
| 24 | - char alpha2[2]; |
| 25 | + char alpha2[3]; |
| 26 | int hits; |
| 27 | |
| 28 | memset(rd, 0, sizeof(*rd)); |
| 29 | -- |
| 30 | 2.35.1 |
| 31 | |