Silence Coverity Scan's concern over password_cmd derefencing.

This is a false positive, the conditions to trigger a NULL derefence
rely on argc changing value. However, this makes it impossible to go
wrong anyway.

Coverity Scan 1436868.
This commit is contained in:
Roger A. Light 2020-11-25 11:04:58 +00:00
parent dac841a342
commit 0713ad38b1

View File

@ -125,6 +125,10 @@ int output_new_password(FILE *fptr, const char *username, const char *password,
char *salt64 = NULL, *hash64 = NULL; char *salt64 = NULL, *hash64 = NULL;
struct mosquitto_pw pw; struct mosquitto_pw pw;
if(password == NULL){
fprintf(stderr, "Error: Internal error, no password given.\n");
return 1;
}
memset(&pw, 0, sizeof(pw)); memset(&pw, 0, sizeof(pw));
pw.hashtype = hashtype; pw.hashtype = hashtype;