summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/crypt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index 1c0b301ca8..aa71099382 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -122,7 +122,10 @@ PHP_FUNCTION(crypt)
char salt[PHP3_MAX_SALT_LEN+1];
pval *arg1, *arg2;
- salt[0]='\0';
+ salt[0]=salt[PHP3_MAX_SALT_LEN]='\0';
+ /* This will produce suitable results if people depend on DES-encryption
+ available (passing always 2-character salt). At least for glibc6.1 */
+ memset(&salt[1], '$', PHP3_MAX_SALT_LEN-1);
switch (ARG_COUNT(ht)) {
case 1: