Browse Source

base-files: reject invalid uci keys in network_get_device() and related procedures (#13886)

SVN-Revision: 37345
Jo-Philipp Wich 12 years ago
parent
commit
55178554c2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      package/base-files/files/lib/functions/network.sh

+ 4 - 0
package/base-files/files/lib/functions/network.sh

@@ -25,6 +25,10 @@ __network_parse_ifstatus()
 	local __list
 	local __list
 	local __old_ns
 	local __old_ns
 
 
+	case "$__iface" in
+		*[^a-zA-Z0-9_]*) return 1 ;;
+	esac
+
 	__network_export __tmp "${__key}__parsed" && return 0
 	__network_export __tmp "${__key}__parsed" && return 0
 	__tmp="$(ubus call network.interface."$__iface" status 2>/dev/null)"
 	__tmp="$(ubus call network.interface."$__iface" status 2>/dev/null)"
 	[ -n "$__tmp" ] || return 1
 	[ -n "$__tmp" ] || return 1