mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-28 08:22:56 +02:00
proplib: update to 0.6.7.
This commit is contained in:
parent
edbd4f387d
commit
aa6e307a59
4 changed files with 3 additions and 112 deletions
|
@ -1,52 +0,0 @@
|
||||||
From 903e696b47fc469004598a5671965b31e902c544 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Juan RP <xtraeme@gmail.com>
|
|
||||||
Date: Sun, 11 Jan 2015 17:07:55 +0100
|
|
||||||
Subject: [PATCH] prop_zlib: use a stack buffer to avoid an extra alloc/free.
|
|
||||||
|
|
||||||
Merged from xbps.
|
|
||||||
---
|
|
||||||
src/prop_zlib.c | 12 ++----------
|
|
||||||
1 file changed, 2 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git src/prop_zlib.c src/prop_zlib.c
|
|
||||||
index f764eee..539ee76 100644
|
|
||||||
--- src/prop_zlib.c
|
|
||||||
+++ src/prop_zlib.c
|
|
||||||
@@ -1,5 +1,5 @@
|
|
||||||
/*-
|
|
||||||
- * Copyright (c) 2010-2012 Juan Romero Pardines.
|
|
||||||
+ * Copyright (c) 2010-2014 Juan Romero Pardines.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
@@ -58,7 +58,7 @@ prop ## type ## _internalize_from_zfile(const char *fname) \
|
|
||||||
struct _prop_object_internalize_mapped_file *mf; \
|
|
||||||
prop ## type ## _t obj = NULL; \
|
|
||||||
z_stream strm; \
|
|
||||||
- unsigned char *out; \
|
|
||||||
+ unsigned char out[_READ_CHUNK+1]; \
|
|
||||||
char *uncomp_xml = NULL; \
|
|
||||||
size_t have; \
|
|
||||||
ssize_t totalsize = 0; \
|
|
||||||
@@ -78,13 +78,6 @@ prop ## type ## _internalize_from_zfile(const char *fname) \
|
|
||||||
if (uncomp_xml == NULL) \
|
|
||||||
goto out; \
|
|
||||||
\
|
|
||||||
- /* temporary output buffer for inflate */ \
|
|
||||||
- out = _PROP_MALLOC(_READ_CHUNK, M_TEMP); \
|
|
||||||
- if (out == NULL) { \
|
|
||||||
- _PROP_FREE(uncomp_xml, M_TEMP); \
|
|
||||||
- goto out; \
|
|
||||||
- } \
|
|
||||||
- \
|
|
||||||
/* Decompress the mmap'ed buffer with zlib */ \
|
|
||||||
strm.zalloc = Z_NULL; \
|
|
||||||
strm.zfree = Z_NULL; \
|
|
||||||
@@ -123,7 +116,6 @@ out2: \
|
|
||||||
(void)inflateEnd(&strm); \
|
|
||||||
out1: \
|
|
||||||
obj = prop ## type ## _internalize(uncomp_xml); \
|
|
||||||
- _PROP_FREE(out, M_TEMP); \
|
|
||||||
_PROP_FREE(uncomp_xml, M_TEMP); \
|
|
||||||
out: \
|
|
||||||
_prop_object_internalize_unmap_file(mf); \
|
|
|
@ -1,34 +0,0 @@
|
||||||
From 23ea15715c90bb3e85fd0392d7e1c7b2e94a3898 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Juan RP <xtraeme@gmail.com>
|
|
||||||
Date: Sun, 11 Jan 2015 17:08:46 +0100
|
|
||||||
Subject: [PATCH] prop_object: check sysconf() return value.
|
|
||||||
|
|
||||||
Merged from xbps.
|
|
||||||
---
|
|
||||||
src/prop_object.c | 10 ++++++++--
|
|
||||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git src/prop_object.c src/prop_object.c
|
|
||||||
index a94015d..27f54b1 100644
|
|
||||||
--- src/prop_object.c
|
|
||||||
+++ src/prop_object.c
|
|
||||||
@@ -903,11 +903,17 @@ _prop_object_internalize_map_file(const char *fname)
|
|
||||||
{
|
|
||||||
struct stat sb;
|
|
||||||
struct _prop_object_internalize_mapped_file *mf;
|
|
||||||
- size_t pgsize = (size_t)sysconf(_SC_PAGESIZE);
|
|
||||||
- size_t pgmask = pgsize - 1;
|
|
||||||
+ long scps = sysconf(_SC_PAGESIZE);
|
|
||||||
+ size_t pgsize, pgmask;
|
|
||||||
bool need_guard = false;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
+ if (scps == -1)
|
|
||||||
+ return NULL;
|
|
||||||
+
|
|
||||||
+ pgsize = (size_t)scps;
|
|
||||||
+ pgmask = pgsize -1;
|
|
||||||
+
|
|
||||||
mf = _PROP_MALLOC(sizeof(*mf), M_TEMP);
|
|
||||||
if (mf == NULL)
|
|
||||||
return (NULL);
|
|
|
@ -1,23 +0,0 @@
|
||||||
From b2a0db1b8239f94323c2e6f8edd99a965baa9f18 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Juan RP <xtraeme@gmail.com>
|
|
||||||
Date: Sun, 11 Jan 2015 17:09:34 +0100
|
|
||||||
Subject: [PATCH] prop_data: make sure there's no overflow.
|
|
||||||
|
|
||||||
Found by coverity and merged from xbps.
|
|
||||||
---
|
|
||||||
src/prop_data.c | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git src/prop_data.c src/prop_data.c
|
|
||||||
index abb7b18..4d0ae2c 100644
|
|
||||||
--- src/prop_data.c
|
|
||||||
+++ src/prop_data.c
|
|
||||||
@@ -565,6 +565,8 @@ _prop_data_internalize(prop_stack_t stack, prop_object_t *obj,
|
|
||||||
NULL) == false)
|
|
||||||
return (true);
|
|
||||||
|
|
||||||
+ if (len + 1 >= SIZE_MAX)
|
|
||||||
+ return true;
|
|
||||||
/*
|
|
||||||
* Always allocate one extra in case we don't land on an even byte
|
|
||||||
* boundary during the decode.
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'proplib'
|
# Template file for 'proplib'
|
||||||
pkgname=proplib
|
pkgname=proplib
|
||||||
version=0.6.4
|
version=0.6.7
|
||||||
revision=5
|
revision=1
|
||||||
wrksrc="portableproplib-${version}"
|
wrksrc="portableproplib-${version}"
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
hostmakedepends="automake libtool"
|
hostmakedepends="automake libtool"
|
||||||
|
@ -11,7 +11,7 @@ maintainer="Juan RP <xtraeme@voidlinux.org>"
|
||||||
license="BSD-2-Clause"
|
license="BSD-2-Clause"
|
||||||
homepage="https://github.com/xtraeme/portableproplib"
|
homepage="https://github.com/xtraeme/portableproplib"
|
||||||
distfiles="https://github.com/xtraeme/portableproplib/archive/${version}.tar.gz"
|
distfiles="https://github.com/xtraeme/portableproplib/archive/${version}.tar.gz"
|
||||||
checksum=b2edac8977fa2e569e8664976d9c27f272bcf13f1aa921e853f129b7fd6b5d86
|
checksum=ea295cdba89d842b7895fe9ae854135981ed538a8f1296f462801ce843505ce2
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vlicense COPYING
|
vlicense COPYING
|
||||||
|
|
Loading…
Add table
Reference in a new issue