libxdg-basedir: fix overflow

closes #5958
This commit is contained in:
maxice8 2019-02-19 09:39:38 -03:00
parent efe1a8beb0
commit aac97e13f5
No known key found for this signature in database
GPG Key ID: 543B9D4F4299F06B
2 changed files with 33 additions and 5 deletions

View File

@ -0,0 +1,23 @@
From 14e000f696ef8b83264b0ca4407669bdb365fb23 Mon Sep 17 00:00:00 2001
From: Timmy Weerwag <timmy@timmyweerwag.nl>
Date: Sun, 16 Mar 2014 17:54:14 +0100
Subject: [PATCH] Overflow bug
---
src/basedir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/basedir.c b/src/basedir.c
index 68ab879..1a2a8c4 100644
--- src/basedir.c
+++ src/basedir.c
@@ -574,7 +574,7 @@ static char * xdgGetRelativeHome(const char *envname, const char *relativefallba
unsigned int homelen;
if (!(home = xdgGetEnv("HOME")))
return NULL;
- if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength))) return NULL;
+ if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength+1))) return NULL;
memcpy(relhome, home, homelen);
memcpy(relhome+homelen, relativefallback, fallbacklength+1);
}

View File

@ -1,15 +1,20 @@
# Template file for 'libxdg-basedir'
pkgname=libxdg-basedir
version=1.2.0
revision=3
revision=4
wrksrc="${pkgname}-${pkgname}-${version}"
build_style=gnu-configure
hostmakedepends="automake libtool"
short_desc="Implementation of the XDG Base Directory Specifications"
maintainer="Juan RP <xtraeme@voidlinux.org>"
license="MIT"
homepage="http://n.ethz.ch/student/nevillm/download/libxdg-basedir"
#distfiles="${homepage}/${pkgname}-${version}.tar.gz"
distfiles="http://pkgs.fedoraproject.org/lookaside/pkgs/${pkgname}/${pkgname}-${version}.tar.gz/027aaf1495f6ffa4b5a563b511d5d3f3/${pkgname}-${version}.tar.gz"
checksum=dbabd6967130a443003eef8d5df46e518e7c929c56fc0aab6caa135508b874ce
homepage="https://github.com/devnev/libxdg-basedir"
distfiles="https://github.com/devnev/libxdg-basedir/archive/libxdg-basedir-${version}.tar.gz"
checksum=1c2b0032a539033313b5be2e48ddd0ae94c84faf21d93956d53562eef4614868
pre_configure() {
autoreconf -fi
}
post_install() {
vlicense COPYING