summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>2018-08-25 13:29:42 +0000
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>2018-08-25 13:29:42 +0000
commit0c22a1324ecfa996657dd31931dd34774ee85977 (patch)
treebed400359cec592a2b23bfa56ddf85acfed750c0
parent103088d71ea4418b1c4779bfa0d37c61d83a2d7f (diff)
downloadlibapr-0c22a1324ecfa996657dd31931dd34774ee85977.tar.gz
Fix a potential usage of an un-init variable. (i.e. 'wch')
Up to now, this can NOT happen, because the only caller passes -1 for 'args'. So axe this useless parameter to avoid troubles. See PR 60086. Backport of r1832203 from trunk resp. r1839047 from 1.7.x. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1839048 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--misc/win32/start.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/misc/win32/start.c b/misc/win32/start.c
index eb77d4a4d..131d55622 100644
--- a/misc/win32/start.c
+++ b/misc/win32/start.c
@@ -39,7 +39,7 @@ int APR_DECLARE_DATA apr_app_init_complete = 0;
* _CRT_BLOCK to trick the system into trusting our store.
*/
static int warrsztoastr(const char * const * *retarr,
- const wchar_t * arrsz, int args)
+ const wchar_t * arrsz)
{
const apr_wchar_t *wch;
apr_size_t totlen;
@@ -50,11 +50,9 @@ static int warrsztoastr(const char * const * *retarr,
char *strs;
int arg;
- if (args < 0) {
- for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
- if (!*wch)
- ++args;
- }
+ for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
+ if (!*wch)
+ ++args;
wsize = 1 + wch - arrsz;
/* This is a safe max allocation, we will alloc each
@@ -134,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
}
sysstr = GetEnvironmentStringsW();
- dupenv = warrsztoastr(&_environ, sysstr, -1);
+ dupenv = warrsztoastr(&_environ, sysstr);
if (env) {
*env = apr_malloc_dbg((dupenv + 1) * sizeof (char *),