Skip to content
Snippets Groups Projects
Commit 5d953264 authored by rswindell's avatar rswindell
Browse files

Added typecasts to address MSVC10 assertions (in debug builds).

Added comment about stack variable buffer overflow sighting.
parent 65cf415c
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2013 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -1924,7 +1924,7 @@ static void unescape(char *p) ...@@ -1924,7 +1924,7 @@ static void unescape(char *p)
dst=p; dst=p;
for(;*p;p++) { for(;*p;p++) {
if(*p=='%' && isxdigit(*(p+1)) && isxdigit(*(p+2))) { if(*p=='%' && isxdigit((uchar)*(p+1)) && isxdigit((uchar)*(p+2))) {
sprintf(code,"%.2s",p+1); sprintf(code,"%.2s",p+1);
*(dst++)=(char)strtol(code,NULL,16); *(dst++)=(char)strtol(code,NULL,16);
p+=2; p+=2;
...@@ -2869,7 +2869,7 @@ static BOOL check_request(http_session_t * session) ...@@ -2869,7 +2869,7 @@ static BOOL check_request(http_session_t * session)
{ {
char path[MAX_PATH+1]; char path[MAX_PATH+1];
char curdir[MAX_PATH+1]; char curdir[MAX_PATH+1];
char str[MAX_PATH+1]; char str[MAX_PATH+1]; /* Apr-7-2013: bounds of str can be exceeded, e.g. "s:\sbbs\web\root\http:\vert.synchro.net\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\todolist.ssjs\webctrl.ini" char [261] */
char last_ch; char last_ch;
char* last_slash; char* last_slash;
char* p; char* p;
...@@ -4177,7 +4177,7 @@ js_login(JSContext *cx, uintN argc, jsval *arglist) ...@@ -4177,7 +4177,7 @@ js_login(JSContext *cx, uintN argc, jsval *arglist)
memset(&user,0,sizeof(user)); memset(&user,0,sizeof(user));
if(isdigit(*p)) if(isdigit((uchar)*p))
user.number=atoi(p); user.number=atoi(p);
else if(*p) else if(*p)
user.number=matchuser(&scfg,p,FALSE); user.number=matchuser(&scfg,p,FALSE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment