Commit Graph

33 Commits

Author SHA1 Message Date
Michael Gehring
530149d90d lib/portableproplib: fix various oob reads/segfaults
Applies the following patches from NetBSD:

http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libprop/prop_object.c?rev=1.30&content-type=text/x-cvsweb-markup
http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libprop/prop_object_impl.h?rev=1.31.12.1&content-type=text/x-cvsweb-markup
2016-04-07 15:07:11 +02:00
Juan RP
2130d5daa6 proplib/prop_data: avoid 0 sized allocation reported by clang-analyzer. 2016-02-06 09:41:27 +01:00
Juan RP
8acc375487 portableproplib/prop_object: fix tyops in previous. 2015-07-26 09:16:32 +02:00
Juan RP
0d3c07cdee portableproplib/prop_object: fix an insecure temporary file (CID #62739). 2015-07-26 09:11:20 +02:00
Juan RP
0b7093e108 portableproplib/prop_object: handle possible NULL pointer deref (CID #62722). 2015-07-26 08:10:26 +02:00
Juan RP
2ba31e048a proplib: check for EOF a bit early on the internalized plist. 2015-05-28 09:34:03 +02:00
Juan RP
fd30a00cb4 proplib: fix a NULL pointer dereference when internalizing empty blobs.
_prop_object_internalize_context_alloc: make sure that passed xml string
is not NULL before derefering it a bit later.
2015-05-28 09:14:28 +02:00
Juan RP
f9b6dd9d2d proplib: anonymous mappings need MAP_ANON.
Somehow I removed this accidentally in a previous change... sigh.
2015-03-11 17:06:45 +01:00
Juan RP
b8b4694b33 portableproplib: use posix_madvise rather than madvise.
The posix variant is the standardized version of madvise.
2015-02-15 05:42:18 +01:00
Juan RP
2153c87464 lib/portableproplib/prop_array.c: comment out another debug printf. 2014-11-13 15:22:58 +01:00
Juan RP
3290df5d62 lib/portableproplib/prop_array.c: comment out a debug printf. 2014-11-13 15:22:13 +01:00
Juan RP
43c9497feb Introduce xbps_array_add_first() to insert obj at the head of array.
The behaviour of this routine mimics the existing xbps_array_add() with
the difference that stored objects are moved to the right to insert
our object as the first element on the array.

Use this to add replaced packages in the transaction array at the head
rather than at the end, to preserve the proper sorting order.
2014-11-13 15:18:21 +01:00
Juan RP
fc368e159d lib/portableproplib/prop_zlib.c: use a stack buffer to process compressed chunks. 2014-10-17 10:12:12 +02:00
Juan RP
fe76af7702 proplib: use GCC atomic builtins if supported. 2014-10-09 14:41:43 +02:00
Juan RP
0c74a5d7fe Revert "lib/portableproplib/prop_object.c: CID 62694 (data race condition)"
This reverts commit dc63aed221.
2014-10-07 11:51:53 +02:00
Juan RP
dc63aed221 lib/portableproplib/prop_object.c: CID 62694 (data race condition) 2014-10-07 10:27:07 +02:00
Juan RP
9c5af90fae lib/portableproplib/prop_object.c: CID 62703 (argument cannot be negative) 2014-10-07 10:23:02 +02:00
Juan RP
6a02cb6534 lib/portableproplib/prop_data.c: CID 62728 (integer overflowed argument) 2014-10-07 10:19:32 +02:00
Juan RP
19d36aaf04 portableproplib: use __attribute__((unused)) to fix a unused-but-set-variable warning. 2014-05-29 08:32:14 +02:00
Juan RP
cafbca06e7 Imported portableproplib-0.6.4. 2014-05-17 20:25:14 +02:00
Juan RP
5eea259c13 Remove the config.h kludge and override vasprintf detection via HAVE_VASPRINTF. 2014-01-20 18:50:33 +01:00
Juan RP
e23c64bc84 lib/portableproplib: fixes to allow building with NDEBUG (assert()s disabled). 2013-12-06 11:54:34 +01:00
Juan RP
52fc384e4e Fixed some issues/warnings found by clang-analyzer. 2013-06-20 11:25:43 +02:00
Juan RP
42c0766c00 Get rid of libfetch and proplib external dependencies.
The list of required external deps is now confuse, libarchive and openssl.

libxbps now includes a wrapper for proplib prefixed with xbps_ rather than prop_.
2013-06-20 10:26:12 +02:00
Juan RP
fe922ace4c Merge portable proplib 0.6.3. 2013-03-09 16:41:40 +01:00
Juan RP
2c1e4e502d XBPS can now be built on NetBSD (and probably any other BSD variant). 2012-12-06 12:58:17 +01:00
Juan RP
11ecf5438f Import proplib-0.6.1. 2012-07-10 23:33:19 +02:00
Juan RP
a5c0513686 portableproplib: fix gzFile to make it work with zlib-1.2.6. 2012-02-16 08:51:00 +01:00
Juan RP
f888b582f9 Added a configure script to emulate GNU autoconf and related changes.
Changes included in this set:

 * Added strlcat() and strlcpy() from OpenBSD, always use them if the
   system does not have them built in.
 * Changed an array of PATH_MAX size allocated in the stack, to a dynamically
   allocated buffer from heap. This should reduce memory usage a bit.
 * Simplify code that implemented a homegrown realpath(3) implementation,
   simply use realpath(3).
 * If compiler supports -fstack-protector, build all code with
   -D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all
   buffers are protected.
2010-05-19 22:38:27 +02:00
Juan RP
af6949cc43 Apply the commit from portableproplib's git master:
commit b2975842aba26df9b9885ff56b2ff182eda06152
Author: Juan RP <xtraeme@gmail.com>
Date:   Thu Apr 29 18:23:15 2010 +0200

    Remove some dead code found by the LLVM's clang static analyzer.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100429162412-gq0on6wybpoaazgg
2010-04-29 18:24:12 +02:00
Juan RP
4bef22e190 Add change from portableproplib's git master to fix a warning with -Wextra:
commit 1296cfff2dd84a09f973bd446a75d5b92001506d
Author: Juan RP <xtraeme@gmail.com>
Date:   Wed Apr 21 05:47:34 2010 +0200

    prop_object: add cast for -Wextra.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100421034857-oxkoa87srg5olsrx
2010-04-21 05:48:57 +02:00
Juan RP
ea0d37a104 Incorporate a commit from portableproplib's git master to fix two warnings:
commit 72e03f757660ed295f81315d871e51abe22df9dd
Author: Juan RP <xtraeme@gmail.com>
Date:   Wed Apr 21 05:07:53 2010 +0200

    Add a cast that fixes a warning in the new zlib code.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100421030905-ixl5tj2to573xnxz
2010-04-21 05:09:05 +02:00
Juan RP
6256b34ccc Some changes that will appear in 0.5.0:
* Add proplib-0.4.1 source and use it in XBPS. This is to avoid
   an external dependency, so that we depend on the features of the
   internal library. This also means that proplib is not required anymore.

 * Added support to read/write gzip compressed plists by default, thanks
   to proplib-0.4 that gained new functionality.

That means that from now, XBPS will be able to write compressed gzip
plist files for all metadata related work. This will vastly reduce
bandwidth required for fetching remote repo's pkg index file and
binary packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100420122238-zcb85rudt9p34e10
2010-04-20 14:22:38 +02:00