Snap for 6348860 from b73cea24f89621456c950b102d475ffbd4227334 to rvc-release

Change-Id: I6da26a6b580fff4ee91524f983fe730beead9494
diff --git a/libavb/avb_util.c b/libavb/avb_util.c
index 938ce4e..c0064cf 100644
--- a/libavb/avb_util.c
+++ b/libavb/avb_util.c
@@ -195,6 +195,12 @@
                     size_t str2_len) {
   uint64_t combined_len;
 
+  // Doesn't make sense to pass 0 for buf_size since there's
+  // no room for the terminating NUL byte.
+  if (buf_size == 0) {
+    return false;
+  }
+
   if (!avb_safe_add(&combined_len, str1_len, str2_len)) {
     avb_error("Overflow when adding string sizes.\n");
     return false;