From 9006be70fd75641136a5a230f613498d5082bb3d Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Thu, 12 Jan 2017 20:16:40 +0100 Subject: [PATCH] auction: check for empty pricelist --- src/auction/gnunet-auction-create.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/auction/gnunet-auction-create.c b/src/auction/gnunet-auction-create.c index dc43f635e..a4c029572 100644 --- a/src/auction/gnunet-auction-create.c +++ b/src/auction/gnunet-auction-create.c @@ -113,6 +113,11 @@ run (void *cls, "could not get `prices` array node from pricemap\n"); goto fail; } + if (0 == json_array_size (parray)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "empty pricemap array\n"); + goto fail; + } json_array_foreach (parray, i, pnode) { if (-1 == json_unpack_ex (pnode, &jerr, 0, "F", &cur)) -- 2.25.1