summaryrefslogtreecommitdiff
path: root/lib/auth/psk_passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/auth/psk_passwd.c')
-rw-r--r--lib/auth/psk_passwd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/auth/psk_passwd.c b/lib/auth/psk_passwd.c
index 4bdb4e02c4..a0427914f9 100644
--- a/lib/auth/psk_passwd.c
+++ b/lib/auth/psk_passwd.c
@@ -100,7 +100,8 @@ static bool username_matches(const gnutls_datum_t *username,
i++;
}
- if (line[0] == '#') {
+ /* if format is in hex, e.g. #FAFAFA */
+ if (line[0] == '#' && line_size > 1) {
hexline.data = (void *) &line[1];
hexline.size = i - 1;