void-packages/srcpkgs/proplib/patches/overflow-protection.patch

24 lines
694 B
Diff
Raw Normal View History

2019-01-01 06:57:08 +01:00
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.