auction: check for empty pricelist
authorMarkus Teich <teichm@fs.tum.de>
Thu, 12 Jan 2017 19:16:40 +0000 (20:16 +0100)
committerMarkus Teich <teichm@fs.tum.de>
Thu, 12 Jan 2017 19:18:09 +0000 (20:18 +0100)
src/auction/gnunet-auction-create.c

index dc43f635ee45a7613812a29eb2e70a4e32f2f721..a4c0295725baba30d5e2ae6e3a69c0eec4a0a313 100644 (file)
@@ -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))