From patchwork Sun Jul 19 18:21:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3267 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4B8tVW4V8Qz3xSn for ; Sun, 19 Jul 2020 18:21:55 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4B8tVT3MRrz1px; Sun, 19 Jul 2020 18:21:53 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4B8tVT0F5Xz2yFB; Sun, 19 Jul 2020 18:21:53 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4B8tVR2ShFz2xh3 for ; Sun, 19 Jul 2020 18:21:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4B8tVN6d5mz1h9; Sun, 19 Jul 2020 18:21:48 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1595182909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=6raE2bcjf7snYj8Z+e46z59eXiG5Qfm6us+dNot+JmQ=; b=9rgQyhiWvxQ9fz1xF8HEpUphXfmVcZ36oZg4NM0vnmSvmnexYJSw6yOzGOii1SWTKnuV8g 6KlUjz8yLBFar9Cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1595182909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=6raE2bcjf7snYj8Z+e46z59eXiG5Qfm6us+dNot+JmQ=; b=m9G+U4/Ar+uIoGI439YXtcdo8mjFmPYHGrKpvbi2AMMsDtl+p2PNgA75SHD2HTFTqiwswv /AVjSaiT1BSNel3atFw2UnZvCVjmN/ZNG5pbalsmGLt5oqm99lcBli6UXhvKNzAzVgeVqj i9zlVEkTJF71blLjsUs3S7E2jmNyDSxRRoCh3ZUEJqWRF2YycSQ2FcJbjZZDgBxeDspUQV /PC9qbtf1HfyCmShJjpXlhp/twqu5/vnSLWIrDrYtgHl/oE2M+PU1OVtGJ5eIhMkmjNGWE PAfzBmwF/tCAn+Gm5qd0wKsPeGDVivB7O9nzCmvAh4AGYFozF2c7Q5d9zpHlfQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] libloc: Add upstream patch to fix a buffer issue. Date: Sun, 19 Jul 2020 20:21:41 +0200 Message-Id: <20200719182141.3672-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- lfs/libloc | 3 +++ ...te-buffer-when-reading-from-database.patch | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/patches/libloc-0.9.3-country-terminate-buffer-when-reading-from-database.patch diff --git a/lfs/libloc b/lfs/libloc index 5cf3e0819..4f392baca 100644 --- a/lfs/libloc +++ b/lfs/libloc @@ -78,6 +78,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xvf $(DIR_DL)/$(DL_FILE) + # Apply upstream patches + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/libloc-0.9.3-country-terminate-buffer-when-reading-from-database.patch + # Add patch for i585 to disable the stack protector. cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/libloc-0.9.3-perl-no-stack-protector.patch diff --git a/src/patches/libloc-0.9.3-country-terminate-buffer-when-reading-from-database.patch b/src/patches/libloc-0.9.3-country-terminate-buffer-when-reading-from-database.patch new file mode 100644 index 000000000..0ad9229fd --- /dev/null +++ b/src/patches/libloc-0.9.3-country-terminate-buffer-when-reading-from-database.patch @@ -0,0 +1,24 @@ +commit 61d3516bbfce6b4e6393825329c07b1e2a88d47d +Author: Michael Tremer +Date: Mon Jul 13 10:47:30 2020 +0000 + + country: Terminate buffer when reading from database + + Compilers on ARM do not seem to initialise the buffer. + + Signed-off-by: Michael Tremer + +diff --git a/src/country.c b/src/country.c +index d6ddf50..2ba93e6 100644 +--- a/src/country.c ++++ b/src/country.c +@@ -125,6 +125,9 @@ int loc_country_new_from_database_v1(struct loc_ctx* ctx, struct loc_stringpool* + // Read country code + loc_country_code_copy(buffer, dbobj->code); + ++ // Terminate buffer ++ buffer[2] = '\0'; ++ + // Create a new country object + int r = loc_country_new(ctx, country, buffer); + if (r)