diff options
author | Tomas Mraz <tmraz@fedoraproject.org> | 2014-06-19 13:43:26 +0200 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2014-06-19 13:43:26 +0200 |
commit | 696d4cc68fb60461081e5f29c6ef3094feebac8d (patch) | |
tree | 82009161b88e90cb942639565eb818127aed9857 /modules/pam_unix/md5_crypt.c | |
parent | 78b16874b1348ae63785bbbdee9c624989aaf5c0 (diff) | |
download | pam-696d4cc68fb60461081e5f29c6ef3094feebac8d.tar.gz pam-696d4cc68fb60461081e5f29c6ef3094feebac8d.tar.bz2 pam-696d4cc68fb60461081e5f29c6ef3094feebac8d.zip |
pam_unix: check for NULL return from malloc()
* modules/pam_unix/md5_crypt.c (crypt_md5): Check for NULL return from malloc().
Diffstat (limited to 'modules/pam_unix/md5_crypt.c')
-rw-r--r-- | modules/pam_unix/md5_crypt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/pam_unix/md5_crypt.c b/modules/pam_unix/md5_crypt.c index 53972fcc..4ab9ec84 100644 --- a/modules/pam_unix/md5_crypt.c +++ b/modules/pam_unix/md5_crypt.c @@ -51,6 +51,8 @@ char *MD5Name(crypt_md5)(const char *pw, const char *salt) /* TODO: now that we're using malloc'ed memory, get rid of the strange constant buffer size. */ passwd = malloc(120); + if (passwd == NULL) + return NULL; /* If it starts with the magic string, then skip that */ if (!strncmp(sp, magic, strlen(magic))) |