From 1e5869c660ce3a974f2d7455e9e592ed6b81aecb Mon Sep 17 00:00:00 2001 From: "Frank M. Kromann" Date: Fri, 27 Feb 2004 23:03:07 +0000 Subject: [PATCH] Define buffer size macro and add a comment about the buffer size. --- ext/fbsql/php_fbsql.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c index de5baa2473..18c00ddc1e 100644 --- a/ext/fbsql/php_fbsql.c +++ b/ext/fbsql/php_fbsql.c @@ -163,6 +163,8 @@ struct PHPFBLink #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 @@ char *DigestPassword(char *user, char *password) 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); -- 2.50.1