[462154] Fix problems parsing config strings with leading spaces.

Thanks to Aidan Gill.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=462154
pull/211/merge
Roger A. Light 11 years ago
parent e310092f44
commit c6450ac265

@ -1,5 +1,7 @@
Broker:
- Fix possible crash when using pattern ACLs.
- Fix problems parsing config strings with multiple leading spaces. Closes
#462154.
Client library:
- Inflight limits should only apply to outgoing messages. Closes #461620.

@ -1967,6 +1967,10 @@ static int _conf_parse_string(char **token, const char *name, char **value, char
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate %s value in configuration.", name);
return MOSQ_ERR_INVAL;
}
/* Deal with multiple spaces at the beginning of the string. */
while((*token)[0] == ' '){
(*token)++;
}
*value = _mosquitto_strdup(*token);
if(!*value){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory.");

Loading…
Cancel
Save