/[v1]/trunk/c++/src/dbapi/driver/ftds100/freetds/dblib/dblib.c
ViewVC logotype

Log of /trunk/c++/src/dbapi/driver/ftds100/freetds/dblib/dblib.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 99086 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 10 15:26:35 2023 UTC (15 months, 4 weeks ago) by ucko
File length: 255637 byte(s)
Diff to previous 94026
FreeTDS: Make clearly safe narrowing conversions explicit.  JIRA: CXX-3707.

Revision 94026 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 15 18:41:00 2021 UTC (2 years, 11 months ago) by ucko
File length: 255511 byte(s)
Diff to previous 80715
FreeTDS: Address more LLVM Clang static analyzer (scan-build) feedback.

- query.c (tds_put_param_as_string): Bail immediately if
  tds_convert_string fails.
- ct_bind: Drop redundant early colinfo assignment.
- dbprrow: Bail if somehow first encountering a non-REG_ROW, in which
  case col_printlens will still be null.

- lang_ct_param.c (insert_test): Zero-initialize rows_found.
- rpc_ct_setparam.c (ex_display_results): Avoid memory leaks in some
  error cases.
- dblib t001{3,4}.c (test): Avoid leaks when unable to open output file.

JIRA: CXX-5700.

Revision 80715 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 22:07:52 2017 UTC (6 years, 5 months ago) by ucko
File length: 255422 byte(s)
Diff to previous 80685
Fix FreeTDS 1.0 compilation errors in single-threaded builds. JIRA: CXX-9729.

Revision 80685 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:57:09 2017 UTC (6 years, 5 months ago) by ucko
File length: 255393 byte(s)
Diff to previous 80680
Address Clang static analyzer errors, many long-standing.

There were corner cases in which NULL pointer dereferences, memory
leaks, use of freed memory, or 0-sized allocations (technically yielding
undefined behavior) could occur, at least in theory.

TRUNK-0.95: 487516, 536372.  JIRA: CXX-9729.

Revision 80680 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:51:16 2017 UTC (6 years, 5 months ago) by ucko
File length: 255363 byte(s)
Diff to previous 80673
Address FreeTDS 1.0 compiler warnings.

* Harmonize type usage, via explicit casts where necessary (and safe).
  In particular, ensure that upstream tests' tds_thread_proc routines
  know to return DWORD rather than void* on Windows.
* Ensure that any headers checking (TDS_)HAVE_* #include <config.h> first.
* Keep static assertions warning-free by using _Static_assert where
  available.
* Ensure that members of types that should be unhidden have unhidden
  forward declarations; likewise for their members, recursively.
* Remove (comment out) unused variables and constants.
* Express -2**31 and -2**63 in a manner all compilers accept happily.
* For LLVM Clang, substitute __attribute__((visibility("default")))
  for __attribute__((externally_visible)), which it doesn't support.
* Add no-op default: cases to switch statements that don't explicitly
  cover all of TDS_SERVER_TYPE.
* ctlib.h: #define _CS_CURS_TYPE_* to TDS_CURSOR_STATE_* rather than
  (typelessly) duplicating their values.
* thread.h: Correct tds_thread_proc and TDS_THREAD_PROC_DECLARE; Windows
  threads are expected to return DWORD, not void*.
* dblib/bcp.c (_bcp_get_col_data): Remove a redundant test for
  non-negativity.
* dblib/dblib.c: Express -2?\194?\179?\194?\185 in a manner all compilers accept happily.
* odbc/unittests/attributes.c: Tell the compiler fatal() will never return.
* odbc/unittests/common.h: When the ODBC 3 API is available, favor
  SQLSetStmtAttr over SQLSetStmtOption, which is deprecated.
* tds/convert.c: Rename the string_to_result function to ensure IDEs
  don't conflate it with the identically named wrapper macro.
* tds/gssapi.c: Suppress GSSAPI deprecation warnings on Mac OS X.
* tds/md[45].c: Use TDS_PUT_(U)A4 to populate word32 targets cleanly.
* tds/query.c: #include <sys/socket.h> if available, for send().
* tds/sspi.c: Define _WIN32_WINNT before <config.h>, which might
  otherwise supply a slightly different definition.

TRUNK-0.95: 487511, 554113.  JIRA: CXX-9729.

Revision 80673 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:46:07 2017 UTC (6 years, 5 months ago) by ucko
File length: 254443 byte(s)
Diff to previous 80671
cs_convert, dbconvert: Truncate data as needed; update unit tests.

* Automatically truncate strings that would overflow their destinations,
  mainly for the sake of bulk insertions.  Notify the client at low
  severity (as a warning, essentially).  Update upstream unit tests
  (ctlib t0006, dblib t0019) accordingly.
* Fully honor *BINARY and IMAGE data buffer size limits in cs_convert.

TRUNK-0.95: 487504.  JIRA: CXX-9729.

Revision 80671 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:45:16 2017 UTC (6 years, 5 months ago) by ucko
File length: 254005 byte(s)
Diff to previous 80657
Don't let FreeTDS log directly to stdout or stderr.

* Substitute tdsdump_log, _csclient_msg, or dbperror as appropriate,
  introducing some new error codes for the latter two functions.
* From cs_convert, call _csclient_msg in addition to tdsdump_log.

TRUNK-0.95: 487502.  JIRA: CXX-9729.

Revision 80657 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 28 18:37:35 2017 UTC (6 years, 5 months ago) by ucko
File length: 253794 byte(s)
Diff to previous 80642
dblib.c: Honor dbsetversion in tdsdbopen; improve dbcolinfo and dbwritetext.

* Added static function dbcoltablename.
* Improved function dbcolinfo in order to call dbcoltablename and set an
  appropriate field up.
* Fixed populating of TDS version in tdsdbopen.  (Now done when there
  were explicit calls to dbsetversion.)
* Check dbconvert's return value in dbwritetext.

TRUNK-0.95: 487486.  JIRA: CXX-9729.

Revision 80642 - (view) (download) (as text) (annotate) - [select for diffs]
Added Thu Dec 28 16:33:56 2017 UTC (6 years, 5 months ago) by ucko
File length: 252086 byte(s)
Add upstream FreeTDS files from Branch-1_00, as of 2017-12-28.

Incorporate fixes that didn't make it into the release (many of which
would otherwise have wound up coming in as patches).
Upstream revision ID: R1_00-80-gd40d5e91 (last commit 2017-11-29).

JIRA: CXX-9729.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

NCBI Systems Team">NCBI Systems Team
ViewVC Help
Powered by ViewVC 1.1.20  

HHS Vulnerability Disclosure