Commit e3e52c8f9ab176f65b147d20d58bb7940bd2356a

Authored by Perry Werneck
1 parent f8b40fd8
Exists in master and in 2 other branches develop, macos

Fixing code scanning alerts.

src/core/charset/view.c
@@ -58,7 +58,11 @@ LIB3270_EXPORT int lib3270_charsettable(H3270 *hSession) @@ -58,7 +58,11 @@ LIB3270_EXPORT int lib3270_charsettable(H3270 *hSession)
58 58
59 trace("%s","Showing charset table"); 59 trace("%s","Showing charset table");
60 60
61 - (void) memset((char *) hSession->ea_buf, 0, hSession->view.rows * hSession->view.cols * sizeof(struct lib3270_ea)); 61 + (void) memset(
  62 + (char *) hSession->ea_buf,
  63 + 0,
  64 + ((size_t) hSession->view.rows) * ((size_t) hSession->view.cols) * sizeof(struct lib3270_ea)
  65 + );
62 66
63 baddr = margin_left+hSession->max.cols; 67 baddr = margin_left+hSession->max.cols;
64 s = (hSession->max.cols * 0x11); 68 s = (hSession->max.cols * 0x11);
src/core/rpq.c
@@ -438,7 +438,10 @@ static int get_rpq_timezone(H3270 *hSession) @@ -438,7 +438,10 @@ static int get_rpq_timezone(H3270 *hSession)
438 rpq_warning(hSession, _("RPQ: Unable to determine workstation local time")); 438 rpq_warning(hSession, _("RPQ: Unable to determine workstation local time"));
439 return 1; 439 return 1;
440 } 440 }
441 - memcpy(&here_tm, localtime(&here), sizeof(struct tm)); 441 +
  442 +
  443 +// memcpy(&here_tm, localtime(&here), sizeof(struct tm));
  444 + localtime_r(&here, &here_tm);
442 445
443 if ((utc_tm = gmtime(&here)) == NULL) 446 if ((utc_tm = gmtime(&here)) == NULL)
444 { 447 {
src/core/util.c
@@ -264,7 +264,15 @@ void lib3270_popup_an_errno(H3270 *hSession, int errn, const char *fmt, ...) @@ -264,7 +264,15 @@ void lib3270_popup_an_errno(H3270 *hSession, int errn, const char *fmt, ...)
264 264
265 lib3270_write_log(hSession, "3270", "Error Popup:\n%s\nrc=%d (%s)",text,errn,strerror(errn)); 265 lib3270_write_log(hSession, "3270", "Error Popup:\n%s\nrc=%d (%s)",text,errn,strerror(errn));
266 266
267 - lib3270_popup_dialog(hSession, LIB3270_NOTIFY_ERROR, _( "Error" ), text, "%s (rc=%d)", errn, strerror(errn)); 267 + lib3270_popup_dialog(
  268 + hSession,
  269 + LIB3270_NOTIFY_ERROR,
  270 + _( "Error" ),
  271 + text,
  272 + "%s (rc=%d)",
  273 + strerror(errn),
  274 + errn
  275 + );
268 276
269 lib3270_free(text); 277 lib3270_free(text);
270 278