]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Treat a zero return value from the Win32 APIs MultiByteToWideChar and WideCharToMulti...
authormistachkin <mistachkin@noemail.net>
Wed, 14 Dec 2011 00:37:45 +0000 (00:37 +0000)
committermistachkin <mistachkin@noemail.net>
Wed, 14 Dec 2011 00:37:45 +0000 (00:37 +0000)
FossilOrigin-Name: c65e5a36f1a1c91cb3415158ebe0f5759cbcdf96

manifest
manifest.uuid
src/os_win.c

index 296d435e2222766d7d9c565f26eded0ca8685fb5..7ebd8e4a8828a357b34ce0e549c948ad8256559b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Merge\sthe\snx-devkit\schanges\sinto\strunk.
-D 2011-12-13T15:37:12.235
+C Treat\sa\szero\sreturn\svalue\sfrom\sthe\sWin32\sAPIs\sMultiByteToWideChar\sand\sWideCharToMultiByte\sas\san\serror\scondition.
+D 2011-12-14T00:37:45.399
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -167,7 +167,7 @@ F src/os.h 549b1a2e5e0ed1e1499f252dac126c4973e7379c
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
 F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
 F src/os_unix.c dcb42d74044efcf760c3c03c668e9e7314aa2427
-F src/os_win.c 8af100f78f157eb6185fd9153d7f35b829c4da04
+F src/os_win.c 745cfae00e887ba90452f7ef2a245272c4ed7374
 F src/pager.c d981f3bfcc0e4460537d983899620700ccf8f539
 F src/pager.h 5cd760857707529b403837d813d86b68938d6183
 F src/parse.y fabb2e7047417d840e6fdb3ef0988a86849a08ba
@@ -980,7 +980,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P 169e12295cca701443746b1209bd6a7714fd8988 2eb79efbff9cdab843b172e9fa9fb400c542fab1
-R e5aa0bc552fbb5033b8311d030f5558d
-U drh
-Z afe5f3537b446035b4ee9315704cbe8b
+P 03a70c3dae8d912fccd9d72c575dc372b198d238
+R 29870a4086be96ebc531e67fe7235bdd
+U mistachkin
+Z fc2bb105d27bbafb8656bcd186800dc4
index 2ba39b2ac417f056a3cb9cd1a76f5f3a8f2719f7..5678b5737e51e57f11de737fa5734415f5fab7f6 100644 (file)
@@ -1 +1 @@
-03a70c3dae8d912fccd9d72c575dc372b198d238
\ No newline at end of file
+c65e5a36f1a1c91cb3415158ebe0f5759cbcdf96
\ No newline at end of file
index ae110c541c6f5b4521f604039923ecc794117f2d..bfde4b6f9f19e82827f408b94cbe96bc5bfe7130 100644 (file)
@@ -918,6 +918,9 @@ static LPWSTR utf8ToUnicode(const char *zFilename){
   LPWSTR zWideFilename;
 
   nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0);
+  if( nChar==0 ){
+    return 0;
+  }
   zWideFilename = sqlite3_malloc( nChar*sizeof(zWideFilename[0]) );
   if( zWideFilename==0 ){
     return 0;
@@ -940,6 +943,9 @@ static char *unicodeToUtf8(LPCWSTR zWideFilename){
   char *zFilename;
 
   nByte = osWideCharToMultiByte(CP_UTF8, 0, zWideFilename, -1, 0, 0, 0, 0);
+  if( nByte == 0 ){
+    return 0;
+  }
   zFilename = sqlite3_malloc( nByte );
   if( zFilename==0 ){
     return 0;
@@ -967,6 +973,9 @@ static LPWSTR mbcsToUnicode(const char *zFilename){
 
   nByte = osMultiByteToWideChar(codepage, 0, zFilename, -1, NULL,
                                 0)*sizeof(WCHAR);
+  if( nByte==0 ){
+    return 0;
+  }
   zMbcsFilename = sqlite3_malloc( nByte*sizeof(zMbcsFilename[0]) );
   if( zMbcsFilename==0 ){
     return 0;
@@ -993,6 +1002,9 @@ static char *unicodeToMbcs(LPCWSTR zWideFilename){
   int codepage = osAreFileApisANSI() ? CP_ACP : CP_OEMCP;
 
   nByte = osWideCharToMultiByte(codepage, 0, zWideFilename, -1, 0, 0, 0, 0);
+  if( nByte == 0 ){
+    return 0;
+  }
   zFilename = sqlite3_malloc( nByte );
   if( zFilename==0 ){
     return 0;