Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check that the input is always an even number of chars

  • Loading branch information...
commit a8ed5b7f8c95c107f230afa0e49445ac11aea850 1 parent c6a18ac
@potyl authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/speedkey.c
View
4 src/speedkey.c
@@ -470,6 +470,10 @@ parse_router_arg (int argc , char * const argv[]) {
/* Make sure that the target SSID is in upper case */
hex_ssid_len = strlen(ssid);
+ if (hex_ssid_len % 2) {
+ printf("Odd number of characters in SSID '%s' (%d)\n", arg, (int) hex_ssid_len);
+ exit(1);
+ }
router->bin_ssid_len = hex_ssid_len / 2;
router->hex_ssid = malloc(hex_ssid_len + 1);
router->bin_ssid = malloc(router->bin_ssid_len);
Please sign in to comment.
Something went wrong with that request. Please try again.