]> granicus.if.org Git - php/commitdiff
- Fixed two "jump or move depends on uninitialised value"
authorFelipe Pena <felipe@php.net>
Fri, 17 Jun 2011 02:00:20 +0000 (02:00 +0000)
committerFelipe Pena <felipe@php.net>
Fri, 17 Jun 2011 02:00:20 +0000 (02:00 +0000)
ext/pdo_firebird/firebird_driver.c
ext/pdo_firebird/firebird_statement.c

index c15455563729019d612199426582f5add3c90a0e..d9c61124758ced98f28cfc5ea801fb6c45e731eb 100644 (file)
@@ -232,6 +232,7 @@ static long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len T
        /* TODO no placeholders in exec() for now */
        in_sqlda.version = out_sqlda.version = PDO_FB_SQLDA_VERSION;
        in_sqlda.sqld = out_sqlda.sqld = 0;
+       out_sqlda.sqln = 1;
        
        /* allocate and prepare statement */
        if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0 TSRMLS_CC)) {
index 3d45f185e75baa5b32e3d6976a01c2ab121d8d2e..6dcd09c35a76b1a357a3244426207393875f9cf5 100644 (file)
@@ -191,7 +191,7 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
        char *cp;
        
        /* allocate storage for the column */
-       var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short));
+       var->sqlind = (void*)ecalloc(1, var->sqllen + 2*sizeof(short));
        var->sqldata = &((char*)var->sqlind)[sizeof(short)];
 
        colname_len = (S->H->fetch_table_names && var->relname_length)