aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/win_updater/updater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/win_updater/updater.cpp')
-rw-r--r--linden/indra/win_updater/updater.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/linden/indra/win_updater/updater.cpp b/linden/indra/win_updater/updater.cpp
index 20e41a8..e41ab00 100644
--- a/linden/indra/win_updater/updater.cpp
+++ b/linden/indra/win_updater/updater.cpp
@@ -33,6 +33,7 @@
33#include <wininet.h> 33#include <wininet.h>
34 34
35#include <stdio.h> 35#include <stdio.h>
36#include "llpreprocessor.h"
36#include "llfile.h" 37#include "llfile.h"
37 38
38#define BUFSIZE 8192 39#define BUFSIZE 8192
@@ -81,7 +82,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
81 *cancelled = FALSE; 82 *cancelled = FALSE;
82 83
83 HINTERNET hinet, hdownload; 84 HINTERNET hinet, hdownload;
84 char data[BUFSIZE]; 85 char data[BUFSIZE]; /* Flawfinder: ignore */
85 unsigned long bytes_read; 86 unsigned long bytes_read;
86 87
87#if _DEBUG 88#if _DEBUG
@@ -89,7 +90,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
89 fflush(logfile); 90 fflush(logfile);
90#endif 91#endif
91 92
92 FILE *fp = fopen(path, "wb"); 93 FILE* fp = fopen(path, "wb"); /* Flawfinder: ignore */
93 94
94 if (!fp) 95 if (!fp)
95 { 96 {
@@ -132,7 +133,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled)
132 { 133 {
133#if _DEBUG 134#if _DEBUG
134 DWORD err = GetLastError(); 135 DWORD err = GetLastError();
135 fprintf(logfile,"InternetQueryDataAvailable Failed: %d bytes\n",total_bytes); 136 fprintf(logfile,"InternetQueryDataAvailable Failed: %d bytes Err:%d\n",total_bytes,err);
136 fflush(logfile); 137 fflush(logfile);
137#endif 138#endif
138 return success; 139 return success;
@@ -320,7 +321,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
320 321
321 const int MAX_ARGS = 100; 322 const int MAX_ARGS = 100;
322 int argc = 0; 323 int argc = 0;
323 char *argv[MAX_ARGS]; 324 char* argv[MAX_ARGS]; /* Flawfinder: ignore */
324 325
325#if _DEBUG 326#if _DEBUG
326 logfile = _wfopen(TEXT("updater.log"),TEXT("wt")); 327 logfile = _wfopen(TEXT("updater.log"),TEXT("wt"));
@@ -346,7 +347,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
346 { 347 {
347 argv[argc++] = token; 348 argv[argc++] = token;
348 /* Get next token: */ 349 /* Get next token: */
349 if (*(token + strlen(token) + 1) == '\"') 350 if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */
350 { 351 {
351 token = strtok( NULL, "\""); 352 token = strtok( NULL, "\"");
352 } 353 }
@@ -379,7 +380,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
379 if (gProductName) 380 if (gProductName)
380 { 381 {
381 mbstowcs(window_title, gProductName, 2048); 382 mbstowcs(window_title, gProductName, 2048);
382 wcscat(window_title, L" Updater"); 383 wcscat(window_title, L" Updater"); /* Flawfinder: ignore */
383 } 384 }
384 else 385 else
385 { 386 {
@@ -388,7 +389,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
388 389
389 WNDCLASSEX wndclassex = { 0 }; 390 WNDCLASSEX wndclassex = { 0 };
390 DEVMODE dev_mode = { 0 }; 391 DEVMODE dev_mode = { 0 };
391 char update_exec_path[MAX_PATH]; 392 char update_exec_path[MAX_PATH]; /* Flawfinder: ignore */
392 char *ptr; 393 char *ptr;
393 WCHAR update_uri[4096]; 394 WCHAR update_uri[4096];
394 395
@@ -457,10 +458,10 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
457 *(ptr + 2) = 'x'; 458 *(ptr + 2) = 'x';
458 *(ptr + 3) = 'e'; 459 *(ptr + 3) = 'e';
459 *(ptr + 4) = 0; 460 *(ptr + 4) = 0;
460 wcscpy(update_uri, UPDATE_URIBASE); 461 wcscpy(update_uri, UPDATE_URIBASE); /* Flawfinder: ignore */
461 WCHAR wcmdline[2048]; 462 WCHAR wcmdline[2048];
462 mbstowcs(wcmdline, gUserServer, 2048); 463 mbstowcs(wcmdline, gUserServer, 2048);
463 wcscat(update_uri, wcmdline); 464 wcscat(update_uri, wcmdline); /* Flawfinder: ignore */
464 465
465 int success; 466 int success;
466 int cancelled; 467 int cancelled;
@@ -503,18 +504,18 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
503 } 504 }
504 505
505 // Construct some parameters. 506 // Construct some parameters.
506 char params[2048]; 507 char params[2048]; /* Flawfinder: ignore */
507 if (gIsSilent && gProgramName) 508 if (gIsSilent && gProgramName)
508 { 509 {
509 sprintf(params, "/S /P=\"%s\"", gProgramName); 510 snprintf(params, sizeof(params), "/S /P=\"%s\"", gProgramName); /* Flawfinder: ignore */
510 } 511 }
511 else if (gProgramName) 512 else if (gProgramName)
512 { 513 {
513 sprintf(params, "/P=\"%s\"", gProgramName); 514 snprintf(params, sizeof(params), "/P=\"%s\"", gProgramName); /* Flawfinder: ignore */
514 } 515 }
515 else if (gIsSilent) 516 else if (gIsSilent)
516 { 517 {
517 sprintf(params, "/S"); 518 sprintf(params, "/S"); /* Flawfinder: ignore */
518 } 519 }
519 else 520 else
520 { 521 {