From 33f5ee9195e29c2276c14c707b04bca3ceb08b4d Mon Sep 17 00:00:00 2001 From: bogdan Date: Tue, 15 Aug 2023 11:17:54 +0200 Subject: [PATCH] one more fix of asterisk password string save --- src/RestApiHandler.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/RestApiHandler.c b/src/RestApiHandler.c index 70bf0ca..4fc7b9d 100644 --- a/src/RestApiHandler.c +++ b/src/RestApiHandler.c @@ -308,11 +308,13 @@ esp_err_t SetConfVar(char *name, char *val, rest_var_types *tp) strcpy(V->ref, val); break; case VAR_PASS: - constr = strlen(val); - if (constr < V->minlen || constr > V->maxlen) - return ESP_ERR_INVALID_ARG; - if (strcmp(val, "******")) + if (val[0] != '*') + { + constr = strlen(val); + if (constr < V->minlen || constr > V->maxlen) + return ESP_ERR_INVALID_ARG; strcpy(V->ref, val); + } break; case VAR_IPADDR: