Hi,
2013/12/7 Sat 18:49:37 UTC+9 Ken Takata wrote:
> Hi,
>
> After 7.4.081 static analysis with MSVC10 (Windows SDK 7.1) is supported.
> I compiled 7.4.110 with MSVC10 enabling the static analysis. I attach the
> result of the analysis. Maybe the most of the warnings are false positive,
> but I found some parts which should be fixed.
>
> I fixed the following four warnings:
> c:\work\vim-msvc\src\os_win32.c(2603) : warning C6054: String 'szTrueName'
> might not be zero-terminated: Lines: 2506, 2507, 2508, 2509, 2510, 2511,
> 2512, 2513, 2514, 2516, 2517, 2523, 2524, 2526, 2534, 2603
> c:\work\vim-msvc\src\os_win32.c(2599) : warning C6001: Using uninitialized
> memory 'hFind': Lines: 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514,
> 2516, 2517, 2523, 2524, 2526, 2534, 2537, 2540, 2541, 2542, 2544, 2542, 2546,
> 2550, 2551, 2552, 2560, 2599
> c:\work\vim-msvc\src\os_win32.c(2756) : warning C6054: String 'szTrueName'
> might not be zero-terminated: Lines: 2618, 2619, 2620, 2621, 2622, 2623,
> 2624, 2625, 2626, 2628, 2629, 2632, 2635, 2664, 2668, 2669, 2671, 2679, 2756
> c:\work\vim-msvc\src\os_win32.c(6282) : warning C6001: Using uninitialized
> memory 'argv': Lines: 6249, 6250, 6251, 6253, 6254, 6256, 6257, 6259, 6260,
> 6261, 6263, 6266, 6269, 6261, 6263, 6266, 6269, 6272, 6273, 6272, 6274, 6275,
> 6261, 6281, 6282
>
> Please check the attached patch.
>
> Additionally, I found one suspicious part:
> c:\work\vim-msvc\src\if_py_both.h(3008) : warning C6246: Local declaration of
> 'todecref' hides declaration of the same name in outer scope. For additional
> information, see previous declaration at line '2930' of
> 'c:\work\vim-msvc\src\if_py_both.h': Lines: 2930
>
> Maybe it's better to ask to ZyX.
> It seems that Py_XDECREF() is not called after the call of StringToChars() in
> the line 3010. Is it OK?
Sorry, I sent a wrong patch.
I attach the correct patch.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
# HG changeset patch
# Parent 486655e0c5a21469364d3cf895535137f09b3724
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2509,7 +2509,7 @@
WCHAR *porig, *porigPrev;
int flen;
WIN32_FIND_DATAW fb;
- HANDLE hFind;
+ HANDLE hFind = INVALID_HANDLE_VALUE;
int c;
int slen;
@@ -2517,6 +2517,8 @@
if (flen > _MAX_PATH)
return OK;
+ szTrueName[0] = NUL;
+
/* slash_adjust(name) not needed, already adjusted by fname_case(). */
/* Build the new name in szTrueName[] one component at a time. */
@@ -2664,6 +2666,8 @@
if (flen > _MAX_PATH)
return;
+ szTrueName[0] = NUL;
+
/* Build the new name in szTrueName[] one component at a time. */
porig = name;
ptrue = szTrueName;
@@ -6272,6 +6276,7 @@
while (i > 0)
free(argv[--i]);
free(argv);
+ argv = NULL;
argc = 0;
}
}