[info=fd8cb232fe431f50a83c60c65e0e6a1f963588f7c05ef76de933b3fafeefdf90]

OBS-URL: https://build.opensuse.org/package/show/filesharing/rtorrent?expand=0&rev=14
This commit is contained in:
OBS User unknown 2024-09-29 15:31:15 +00:00 committed by Git OBS Bridge
parent 1d86e50640
commit bd8806f16c
3 changed files with 3 additions and 31 deletions

View File

@ -1,28 +0,0 @@
From 954bfb70f24578ef33b1f77cf1a3d64fc2f2f595 Mon Sep 17 00:00:00 2001
From: Aleksa Sarai <cyphar@cyphar.com>
Date: Mon, 20 Jun 2022 19:09:57 +1000
Subject: [PATCH] utils: lockfile: avoid stack overflow for lockfile buffer
References: https://github.com/rakshasa/rtorrent/pull/1169
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
src/utils/lockfile.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/utils/lockfile.cc b/src/utils/lockfile.cc
index 7d11d8c9970f..fac5cb23e26f 100644
--- a/src/utils/lockfile.cc
+++ b/src/utils/lockfile.cc
@@ -98,7 +98,8 @@ Lockfile::try_lock() {
int pos = ::gethostname(buf, 255);
if (pos == 0) {
- ::snprintf(buf + std::strlen(buf), 255, ":+%i\n", ::getpid());
+ ssize_t len = std::strlen(buf);
+ ::snprintf(buf + len, 255 - len, ":+%i\n", ::getpid());
int __UNUSED result = ::write(fd, buf, std::strlen(buf));
}
--
2.36.1

View File

@ -1,4 +1,4 @@
mtime: 1727623537
commit: 1fabab83e2b4d0b00919eef5b33a3b1beb8421c4045f325150c4a5cefe8ada20
mtime: 1727623746
commit: fd8cb232fe431f50a83c60c65e0e6a1f963588f7c05ef76de933b3fafeefdf90
url: https://src.opensuse.org/jengelh/rtorrent
revision: master

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9441fbaf41970ed9527cb5472d836699c7c4f27a0e2a523fc7e3504308f1b11f
oid sha256:074f000526ee827ae89ef1faed3f30d5390ad469974313151708dc8ac0135d38
size 256