Hi, Per Coverity.
Like the function pg_encoding_max_length_sql (src/backend/utils/mb/mbutils.c) Only assertion is insufficient to avoid accessing array out-of-bounds. This bug is live according Coverity at function: pg_verify_mbstr_len (src/backend/utils/mb/mbutils.c) CID 1469870 (#1 of 1): Out-of-bounds access (OVERRUN)7. overrun-call: Overrunning callee's array of size 42 by passing argument src_encoding (which evaluates to 63) in call to pg_verify_mbstr_len. [show details <https://scan6.scan.coverity.com/eventId=32693869-7&modelId=32693869-0&fileInstanceId=131415642&filePath=%2Fdll%2Fpostgres%2Fpostgres%2Fsrc%2Fbackend%2Futils%2Fmb%2Fmbutils.c&fileStart=1546&fileEnd=1605> ] 633 retval = pg_verify_mbstr_len(src_encoding, src_str, len, false); 634 Trivial patch attached. regards, Ranier Vilela
fix_out_of_bounds_wchar.patch
Description: Binary data