]> granicus.if.org Git - php/commitdiff
Fixed bug #22437.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 4 Mar 2003 16:34:52 +0000 (16:34 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 4 Mar 2003 16:34:52 +0000 (16:34 +0000)
ext/odbc/php_odbc.c

index ba473e8911143c451e2c836b0c94a8712329a03c..4154608c43c726c6f5031a2d237e7441b53f3167 100644 (file)
@@ -2190,10 +2190,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                persistent = 0;
        }
 
-       len = strlen(db) + strlen(uid) + strlen(pwd) + sizeof(ODBC_TYPE) + 5;
-       hashed_details = emalloc(len);
-
-       hashed_len = sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt);
+       hashed_len = spprintf(hashed_details, 0, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt);
 
        /* FIXME the idea of checking to see if our connection is already persistent
                is good, but it adds a lot of overhead to non-persistent connections.  We