avb_str_concat: Fail if 0 is passed for buf_size. am: b73cea24f8 am: b5f275d3b5 am: 66992bbe14

Original change: https://googleplex-android-review.googlesource.com/c/platform/external/avb/+/10889377

Change-Id: I5f93e50e82e2e75509eca550697122ebad04574a
diff --git a/libavb/avb_descriptor.c b/libavb/avb_descriptor.c
index cfc2aac..7030a40 100644
--- a/libavb/avb_descriptor.c
+++ b/libavb/avb_descriptor.c
@@ -88,6 +88,10 @@
   }
 
   for (p = desc_start; p < desc_end;) {
+    if (p + sizeof(AvbDescriptor) > desc_end) {
+      avb_error("Invalid descriptor length.\n");
+      goto out;
+    }
     const AvbDescriptor* dh = (const AvbDescriptor*)p;
     avb_assert_aligned(dh);
     uint64_t nb_following = avb_be64toh(dh->num_bytes_following);