Projects
openEuler:22.03:LTS:LoongArch
util-linux
_service:tar_scm_kernel_repo:backport-last-avoi...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm_kernel_repo:backport-last-avoid-out-of-bounds-array-access.patch of Package util-linux
From 75822efb8e948b538d9e9ccc329a5430fdabb7ea Mon Sep 17 00:00:00 2001 From: biubiuzy <294772273@qq.com> Date: Fri, 23 Feb 2024 17:44:12 +0800 Subject: [PATCH] last: avoid out of bounds array access --- login-utils/last.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/login-utils/last.c b/login-utils/last.c index bbbe817f8..f5a9fec08 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -351,7 +351,10 @@ static int time_formatter(int fmt, char *dst, size_t dlen, time_t *when) { char buf[CTIME_BUFSIZ]; - ctime_r(when, buf); + if (!ctime_r(when, buf)) { + ret = -1; + break; + } snprintf(dst, dlen, "%s", buf); ret = rtrim_whitespace((unsigned char *) dst); break; -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.