changeset bf0b0d15575b in /srv/hg/libpwquality
details:
http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=bf0b...
summary: Sanitize the old and user values before the check.
diffstat:
src/check.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (17 lines):
diff -r 962b02c76a19 -r bf0b0d15575b src/check.c
--- a/src/check.c Wed Aug 06 14:48:57 2014 +0200
+++ b/src/check.c Wed Aug 06 14:56:37 2014 +0200
@@ -503,6 +503,13 @@
char *oldmono = NULL, *newmono, *wrapped = NULL;
char *usermono = NULL;
+ /* Sanitize the old and user values */
+ if (old && *old = '\0')
+ old = NULL;
+
+ if (user && *user = '\0')
+ user = NULL;
+
newmono = str_lower(x_strdup(new));
if (!newmono)
rv = PWQ_ERROR_MEM_ALLOC;