projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e03d41
)
libbb: don't die if crypt() returns NULL
author
Denys Vlasenko
<vda.linux@googlemail.com>
Sun, 9 Feb 2014 13:38:03 +0000
(14:38 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Sun, 9 Feb 2014 13:38:03 +0000
(14:38 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/pw_encrypt.c
patch
|
blob
|
history
diff --git
a/libbb/pw_encrypt.c
b/libbb/pw_encrypt.c
index 39ffa084f29a81ce2817e15a9547a0e9d3fb74a8..bfc7030a8387f81daa44ce8f1ccc6f50e3380233 100644
(file)
--- a/
libbb/pw_encrypt.c
+++ b/
libbb/pw_encrypt.c
@@
-142,7
+142,14
@@
char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
char* FAST_FUNC pw_encrypt(const char *clear, const char *salt, int cleanup)
{
- return xstrdup(crypt(clear, salt));
+ char *s;
+
+ s = crypt(clear, salt);
+ /*
+ * glibc used to return "" on malformed salts (for example, ""),
+ * but since 2.17 it returns NULL.
+ */
+ return xstrdup(s ? s : "");
}
#endif