~ubuntu-branches/ubuntu/natty/psqlodbc/natty

« back to all changes in this revision

Viewing changes to info.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-05-13 10:47:36 UTC
  • Revision ID: james.westby@ubuntu.com-20040513104736-doxck1rd6ng2msgn
Tags: 1:07.03.0200-3
* urgency high since this is a security related bug and no other changes
  were made
* misc.c: added target buffer size parameter to make_string() to prevent
  buffer overflows and corrected all calls to it (closes: #247306)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1387
1387
        show_views = FALSE;
1388
1388
 
1389
1389
        /* make_string mallocs memory */
1390
 
        tableType = make_string(szTableType, cbTableType, NULL);
 
1390
        tableType = make_string(szTableType, cbTableType, NULL, 0);
1391
1391
        if (tableType)
1392
1392
        {
1393
1393
                strcpy(table_types, tableType);
2555
2555
         * only use the table name... the owner should be redundant, and we
2556
2556
         * never use qualifiers.
2557
2557
         */
2558
 
        table_name = make_string(szTableName, cbTableName, NULL);
 
2558
        table_name = make_string(szTableName, cbTableName, NULL, 0);
2559
2559
        if (!table_name)
2560
2560
        {
2561
2561
                SC_set_error(stmt, STMT_INTERNAL_ERROR, "No table name passed to PGAPI_Statistics.");
3009
3009
                internal_asis_type = INTERNAL_ASIS_TYPE;
3010
3010
#endif /* UNICODE_SUPPORT */
3011
3011
        pktab[0] = '\0';
3012
 
        make_string(szTableName, cbTableName, pktab);
 
3012
        make_string(szTableName, cbTableName, pktab, sizeof(pktab));
3013
3013
        if (pktab[0] == '\0')
3014
3014
        {
3015
3015
                SC_set_error(stmt, STMT_INTERNAL_ERROR, "No Table specified to PGAPI_PrimaryKeys.");
3543
3543
        schema_needed[0] = '\0';
3544
3544
        schema_fetched[0] = '\0';
3545
3545
 
3546
 
        make_string(szPkTableName, cbPkTableName, pk_table_needed);
3547
 
        make_string(szFkTableName, cbFkTableName, fk_table_needed);
 
3546
        make_string(szPkTableName, cbPkTableName, pk_table_needed, sizeof(pk_table_needed));
 
3547
        make_string(szFkTableName, cbFkTableName, fk_table_needed, sizeof(fk_table_needed));
3548
3548
 
3549
3549
        conn = SC_get_conn(stmt);
3550
3550
#ifdef  UNICODE_SUPPORT