diff --git a/win_unicode.c b/win_unicode.c index b2e65bb6..07be16f3 100644 --- a/win_unicode.c +++ b/win_unicode.c @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef WIN32 #define FORMAT_SIZE_T "%Iu" @@ -1278,6 +1279,11 @@ SQLLEN bindcol_localize_exec(char *ldt, size_t n, BOOL lf_conv, char **wcsbuf) { SQLLEN l = (-2); + if (n > INT_MAX) { + // Handle error case + return -1; + } + get_convtype(); MYLOG(0, " size=" FORMAT_SIZE_T "\n", n); #if defined(__WCS_ISO10646__)