summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank M. Kromann <fmk@php.net>2004-02-27 23:03:07 +0000
committerFrank M. Kromann <fmk@php.net>2004-02-27 23:03:07 +0000
commit1e5869c660ce3a974f2d7455e9e592ed6b81aecb (patch)
tree3c76976c01f9d05c8a44abad08974a83a2b63e07
parent7fdd68af8bfe70df7b6059ffaf9c5ec039c24c31 (diff)
downloadphp-git-1e5869c660ce3a974f2d7455e9e592ed6b81aecb.tar.gz
Define buffer size macro and add a comment about the buffer size.
-rw-r--r--ext/fbsql/php_fbsql.c4
1 files changed, 3 insertions, 1 deletions
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);