Address issues from static analyzer

Resolves: RHEL-44999
This commit is contained in:
Ondřej Pohořelský 2024-11-06 12:59:44 +01:00
parent 9e970f8ec8
commit bcadf919a3
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,33 @@
diff -ur a/atd.c b/atd.c
--- a/atd.c 2024-11-06 12:48:35.368394905 +0100
+++ b/atd.c 2024-11-06 12:50:09.301052284 +0100
@@ -295,7 +295,7 @@
int fd_out, fd_in, fd_std;
char jobbuf[9];
char *mailname = NULL;
- int mailsize = 128;
+ size_t mailsize = 128;
char *newname;
FILE *stream;
int send_mail = 0;
@@ -308,7 +308,7 @@
char queue;
char fmt[64];
unsigned long jobno;
- int rc;
+ long rc;
char hostbuf[MAXHOSTNAMELEN];
#ifdef WITH_PAM
int retcode;
diff -ur a/posixtm.c b/posixtm.c
--- a/posixtm.c 2022-02-05 11:00:57.000000000 +0100
+++ b/posixtm.c 2024-11-06 12:50:28.143186147 +0100
@@ -188,7 +188,7 @@
bool
posixtime (time_t *p, const char *s, unsigned int syntax_bits)
{
- struct tm tm0;
+ struct tm tm0 = {0};
struct tm tm1;
struct tm const *tm;
time_t t;

View File

@ -3,7 +3,7 @@
Summary: Job spooling tools
Name: at
Version: 3.2.5
Release: 11%{?dist}
Release: 12%{?dist}
# http://packages.debian.org/changelogs/pool/main/a/at/current/copyright
# + install-sh is MIT license with changes under Public Domain
License: GPL-3.0-or-later AND GPL-2.0-or-later AND ISC
@ -30,6 +30,7 @@ Patch: at-3.1.16-clear-nonjobs.patch
Patch: at-3.2.2-lock-locks.patch
Patch: at-3.1.23-document-n.patch
Patch: at-3.1.20-log-jobs.patch
Patch: at-3.2.5-address-issues-from-static-analyzer.patch
BuildRequires: gcc
BuildRequires: flex flex-static bison autoconf
@ -164,6 +165,10 @@ chown root:root %{_localstatedir}/spool/at/.SEQ
%attr(0644,root,root) /%{_unitdir}/atd.service
%changelog
* Wed Nov 06 2024 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-12
- Address issues from static analyzer
Resolves: RHEL-44999
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 3.2.5-11
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018