aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-03-16 19:25:11 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-16 19:25:11 (GMT)
commit42a95533a8a33d2fa31f49ea4f1fc64b7bf002d7 (patch)
treebf6fa1035f7a407a5c57af6c04482b67a78bb799 /hs20
parentec1eae849eec62c1cad7ca393c5fdff4518db033 (diff)
downloadhostap-42a95533a8a33d2fa31f49ea4f1fc64b7bf002d7.zip
hostap-42a95533a8a33d2fa31f49ea4f1fc64b7bf002d7.tar.gz
hostap-42a95533a8a33d2fa31f49ea4f1fc64b7bf002d7.tar.bz2
hs20-osu-client: Fix pol_upd command line parsing
This command was documented as having the Server URL parameter as optional, but the implementation did not match that. Allow this parameter to be left out. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/osu_client.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index f79f59b..c05c57d 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -2570,7 +2570,7 @@ static int cmd_pol_upd(struct hs20_osu_client *ctx, const char *address,
if (!pps_fname) {
char buf[256];
wpa_printf(MSG_INFO, "Determining PPS file based on Home SP information");
- if (os_strncmp(address, "fqdn=", 5) == 0) {
+ if (address && os_strncmp(address, "fqdn=", 5) == 0) {
wpa_printf(MSG_INFO, "Use requested FQDN from command line");
os_snprintf(buf, sizeof(buf), "%s", address + 5);
address = NULL;
@@ -3137,11 +3137,8 @@ int main(int argc, char *argv[])
argc > optind + 2 ? argv[optind + 2] : NULL,
argc > optind + 3 ? argv[optind + 3] : NULL);
} else if (strcmp(argv[optind], "pol_upd") == 0) {
- if (argc - optind < 2) {
- usage();
- exit(0);
- }
- ret = cmd_pol_upd(&ctx, argc > 2 ? argv[optind + 1] : NULL,
+ ret = cmd_pol_upd(&ctx,
+ argc > optind + 1 ? argv[optind + 1] : NULL,
argc > optind + 2 ? argv[optind + 2] : NULL,
argc > optind + 3 ? argv[optind + 3] : NULL);
} else if (strcmp(argv[optind], "prov") == 0) {