Fix the logic for checking config_id 96/310096/1 accepted/tizen/7.0/unified/20240423.164423
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 22 Apr 2024 10:20:39 +0000 (19:20 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 22 Apr 2024 10:20:39 +0000 (19:20 +0900)
In the config_id validity check logic,
it only check whether config_id is in the hex value range or is an unerscore.
But this is causing problems because in reality
it can contain all lowercase letters.
So it was modified to also check for lowercase letters.

* This is a side effect caused by the following patch.
  - Fix Stack buffer overflow and Path traversal

Change-Id: I23d0ebc1cc38b9f9e526df38539155c2308257eb
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/wifi-config.c

index 9a1ab4f8d5e50615dd4a0cdb7c8633a1989a0bc4..2dc7bfc8d133d0918071eb66189fde60e4fec30b 100755 (executable)
@@ -1232,7 +1232,9 @@ gboolean __netconfig_is_valid_config_id(const gchar *config_id)
                return FALSE;
 
        for (int i = 0; i < length; i++) {
-               if (!(isxdigit(config_id[i])) && config_id[i] != '_')
+               if (!(islower(config_id[i])) &&
+                               !(isdigit(config_id[i])) &&
+                               config_id[i] != '_')
                        return FALSE;
        }