From 6cf28ae350015d7ed3971b756318121ae3c8987f Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Fri, 28 Jan 2022 17:37:53 +0100 Subject: [PATCH] Fix complete_incr_bin function Resolves: rhbz#2046734 --- complete-incr-bin.patch | 22 ++++++++++++++++++++++ memcached.spec | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 complete-incr-bin.patch diff --git a/complete-incr-bin.patch b/complete-incr-bin.patch new file mode 100644 index 0000000..d2b70d9 --- /dev/null +++ b/complete-incr-bin.patch @@ -0,0 +1,22 @@ +commit 8dfe2f07847a4ead1c54959de794557713bc9f79 +Author: Tomas Korbar +Date: Fri Jan 28 15:33:14 2022 +0100 + + Expand extbuf buffer + +diff --git a/proto_bin.c b/proto_bin.c +index b61c3bb..50b3591 100644 +--- a/proto_bin.c ++++ b/proto_bin.c +@@ -110,7 +110,10 @@ int try_read_command_binary(conn *c) { + // want to refactor a ton of code either. Header is only ever used out + // of c->binary_header, but the extlen stuff is used for the latter + // bytes. Just wastes 24 bytes on the stack this way. +- char extbuf[sizeof(c->binary_header) + BIN_MAX_EXTLEN+1]; ++ ++ // +4 need to be here because extbuf is used for protocol_binary_request_incr ++ // and its member message is alligned to 48 bytes intead of 44 ++ char extbuf[sizeof(c->binary_header) + BIN_MAX_EXTLEN+4]; + memcpy(extbuf + sizeof(c->binary_header), c->rcurr + sizeof(c->binary_header), + extlen > BIN_MAX_EXTLEN ? BIN_MAX_EXTLEN : extlen); + c->rbytes -= sizeof(c->binary_header) + extlen + keylen; diff --git a/memcached.spec b/memcached.spec index bd915df..28e2da9 100644 --- a/memcached.spec +++ b/memcached.spec @@ -12,7 +12,7 @@ Name: memcached Version: 1.6.13 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 0 Summary: High Performance, Distributed Memory Object Cache @@ -24,6 +24,7 @@ Source1: memcached.sysconfig Source2: https://releases.pagure.org/memcached-selinux/memcached-selinux-1.0.2.tar.gz Patch1: memcached-unit.patch +Patch2: complete-incr-bin.patch BuildRequires: make BuildRequires: gcc libevent-devel systemd @@ -69,6 +70,7 @@ optimised for use with this version of memcached. # and SELinux policy sources into memcached-selinux-X.X %setup -q -b 2 %patch1 -p1 -b .unit +%patch2 -p1 -b .testing %build %configure \ @@ -174,6 +176,10 @@ fi %license ../%{selinuxmoduledir}/COPYING %changelog +* Fri Jan 28 2022 Tomas Korbar - 1.6.13-3 +- Fix complete_incr_bin function +- Resolves: rhbz#2046734 + * Thu Jan 20 2022 Fedora Release Engineering - 0:1.6.13-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild