Validate config strings as UTF-8.
This commit is contained in:
parent
8cb3a29fd7
commit
7bf16919f3
@ -2026,6 +2026,10 @@ static int conf__parse_string(char **token, const char *name, char **value, char
|
||||
while((*token)[0] == ' ' || (*token)[0] == '\t'){
|
||||
(*token)++;
|
||||
}
|
||||
if(mosquitto_validate_utf8(*token, strlen(*token))){
|
||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: Malformed UTF-8 in configuration.");
|
||||
return MOSQ_ERR_INVAL;
|
||||
}
|
||||
*value = mosquitto__strdup(*token);
|
||||
if(!*value){
|
||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory.");
|
||||
|
Loading…
Reference in New Issue
Block a user