fmk Fri Feb 27 18:03:08 2004 EDT
Modified files:
/php-src/ext/fbsql php_fbsql.c
Log:
Define buffer size macro and add a comment about the buffer size.
http://cvs.php.net/diff.php/php-src/ext/fbsql/php_fbsql.c?r1=1.104&r2=1.105&ty=u
Index: php-src/ext/fbsql/php_fbsql.c
diff -u php-src/ext/fbsql/php_fbsql.c:1.104 php-src/ext/fbsql/php_fbsql.c:1.105
--- php-src/ext/fbsql/php_fbsql.c:1.104 Thu Feb 26 15:31:14 2004
+++ php-src/ext/fbsql/php_fbsql.c Fri Feb 27 18:03:07 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_fbsql.c,v 1.104 2004/02/26 20:31:14 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.105 2004/02/27 23:03:07 fmk Exp $ */
/* TODO:
*
@@ -163,6 +163,8 @@
#define FBSQL_LOB_DIRECT 0 /* default */
#define FBSQL_LOB_HANDLE 1 /* default */
+#define DIGEST_BUFFER_SIZE 17 /* fbcDigestPassword() expects a
preallocated buffer for 16 bytes plus termination */
+
int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql);
char *DigestPassword(char *user, char *password)
{
@@ -170,7 +172,7 @@
if (user && strlen(user) && password && strlen(password)) {
char *user_upper = estrdup(user);
- digest = emalloc(17);
+ digest = emalloc(DIGEST_BUFFER_SIZE);
digest[0] = '\0';
(void)fbcDigestPassword(php_strtoupper(user_upper,
strlen(user_upper)), password, digest);
efree(user_upper);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php