Changeset: 3b49dad3d4f7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3b49dad3d4f7
Modified Files:
        clients/odbc/tests/odbcconnect.c
Branch: Aug2024
Log Message:

Fix uninitialized use

Hadn't realized mutf8 decode() reads the *codepoint without writing it first


diffs (14 lines):

diff --git a/clients/odbc/tests/odbcconnect.c b/clients/odbc/tests/odbcconnect.c
--- a/clients/odbc/tests/odbcconnect.c
+++ b/clients/odbc/tests/odbcconnect.c
@@ -559,9 +559,9 @@ gen_utf16(SQLWCHAR *dest, const char *sr
 {
        SQLWCHAR *p = dest;
        uint32_t state = UTF8_ACCEPT;
+       uint32_t codepoint = UTF8_ACCEPT;
        for (size_t i = 0; i < len; i++) {
                unsigned char byte = (unsigned char)src[i];
-               uint32_t codepoint;
                switch (decode(&state, &codepoint, byte)) {
                case UTF8_ACCEPT:
                        if (codepoint <= 0xFFFF) {
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to