From 848e7ffe8cdc957a3a5549cc6571e86624be8845 Mon Sep 17 00:00:00 2001 From: dyoung Date: Thu, 15 May 2008 21:23:33 +0000 Subject: [PATCH] In prop_data_create_data(blob, len), if len == 0, allocate no memory for blob, and leave pd_mutable set to NULL. In this way, avoid tripping over the assertion in prop_data_data_nocopy(). --- common/lib/libprop/prop_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/libprop/prop_data.c b/common/lib/libprop/prop_data.c index 600602c5ada8..d6e7e38f1246 100644 --- a/common/lib/libprop/prop_data.c +++ b/common/lib/libprop/prop_data.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop_data.c,v 1.11 2008/04/28 20:22:53 martin Exp $ */ +/* $NetBSD: prop_data.c,v 1.12 2008/05/15 21:23:33 dyoung Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -224,7 +224,7 @@ prop_data_create_data(const void *v, size_t size) void *nv; pd = _prop_data_alloc(); - if (pd != NULL) { + if (pd != NULL && size != 0) { nv = _PROP_MALLOC(size, M_PROP_DATA); if (nv == NULL) { prop_object_release(pd);