Skip to content
Snippets Groups Projects
Commit da108a93 authored by Matt Johnston's avatar Matt Johnston
Browse files

Don't allow spaces and don't get confused by -o usesyslogd=yes

(option name has another option name as a prefix)
parent e6432b12
Branches
Tags
No related merge requests found
...@@ -824,29 +824,22 @@ badport: ...@@ -824,29 +824,22 @@ badport:
#endif #endif
static int match_extendedopt(const char** strptr, const char *optname) { static int match_extendedopt(const char** strptr, const char *optname) {
int seen_eq = 0;
int optlen = strlen(optname); int optlen = strlen(optname);
const char *str = *strptr; const char *str = *strptr;
while (isspace(*str)) {
++str;
}
if (strncasecmp(str, optname, optlen) != 0) { if (strncasecmp(str, optname, optlen) != 0) {
return DROPBEAR_FAILURE; return DROPBEAR_FAILURE;
} }
str += optlen; str += optlen;
while (isspace(*str) || (!seen_eq && *str == '=')) { if (*str == '=') {
if (*str == '=') { *strptr = str+1;
seen_eq = 1; return DROPBEAR_SUCCESS;
} } else {
++str; return DROPBEAR_FAILURE;
} }
*strptr = str;
return DROPBEAR_SUCCESS;
} }
static int parse_flag_value(const char *value) { static int parse_flag_value(const char *value) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment