[CONCPP-17] Some potential coding bugs Created: 2020-06-29  Updated: 2020-07-27  Resolved: 2020-07-27

Status: Closed
Project: MariaDB Connector/C++
Component/s: General
Affects Version/s: None
Fix Version/s: 0.9.3

Type: Bug Priority: Major
Reporter: Andrew Hutchings (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Some random things when using ASAN and more warnings enabled:

1. ColumnDefinitionCapi.cpp:105 I don't think *metadata->db is what you meant, compiler things you are doing NULL pointer arithmetic
2. Utils.cpp:135 and Utils:162 return a constant as a char*
3. A couple of use-after-free errors hit in mariadb_stmt.c:617. Not sure if that is a Connector/C or CPP issue. Found using TSAN
4. libmariadb doesn't link with dl, fails in Fedora 32. Appears to work when compiling Connector/C on its own though.



 Comments   
Comment by Lawrin Novitsky [ 2020-07-27 ]

1) *metadata->db is correct, a bit inaccurate was to compare it with NULL, but still NULL is still 0, it wasn't really an issue. But fixed that
2) Both cases were in the unused function stub - fixed
3) I believe that is the same issue as CONCPP-14. Thus - fixed
4) Didn't really look into this. But I guess it's ok for now. Maybe can be moved to a separate ticket
Commit b0a7ea6

Generated at Thu Feb 08 03:07:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.