mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 12:48:51 +00:00
Merge branch 'secret-tool-stdin-check-utf8' into 'master'
secret-tool: Verify that the parsed stdin password is vaild UTF-8 See merge request GNOME/libsecret!130
This commit is contained in:
commit
4c5941505e
@ -272,9 +272,13 @@ read_password_stdin (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Verify that the password really is utf-8 text. */
|
if (g_utf8_validate (password, -1, NULL)) {
|
||||||
return secret_value_new_full (password, length, "text/plain",
|
return secret_value_new_full (password, length, "text/plain",
|
||||||
(GDestroyNotify)secret_password_free);
|
(GDestroyNotify)secret_password_free);
|
||||||
|
} else {
|
||||||
|
g_printerr ("%s: password not valid UTF-8\n", g_get_prgname ());
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static SecretValue *
|
static SecretValue *
|
||||||
|
Loading…
Reference in New Issue
Block a user