cvs: /php4/ext/standard crypt.c

From: Date: Mon, 06 Sep 1999 13:24:36 +0000
Subject: cvs: /php4/ext/standard crypt.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-4155@lists.php.net to get a copy of this message
riffraff Mon Sep 6 09:24:36 1999 EDT Modified files: /php4/ext/standard crypt.c Log: Workaround for crypt() getting too few characters for salt. Index: php4/ext/standard/crypt.c diff -u php4/ext/standard/crypt.c:1.8 php4/ext/standard/crypt.c:1.9 --- php4/ext/standard/crypt.c:1.8 Tue Aug 17 14:21:04 1999 +++ php4/ext/standard/crypt.c Mon Sep 6 09:24:36 1999 @@ -17,7 +17,7 @@ | Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: crypt.c,v 1.8 1999/08/17 18:21:04 sas Exp $ */ +/* $Id: crypt.c,v 1.9 1999/09/06 13:24:36 riffraff Exp $ */ #include <stdlib.h> #include "php.h" @@ -122,7 +122,10 @@ 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:

« previous php.version4 (#4155) next »