Replace comment with static assert.

Addressing review comment in
https://boringssl-review.googlesource.com/c/boringssl/+/55449/1/crypto/asn1/a_strex.c

Bug: 516
Change-Id: I97a74b2d6b041961a573c124c69748e01c0e49d8
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/55505
Reviewed-by: Bob Beck <bbe@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c
index 229de94..f21d146 100644
--- a/crypto/asn1/a_strex.c
+++ b/crypto/asn1/a_strex.c
@@ -59,6 +59,7 @@
 #include <assert.h>
 #include <ctype.h>
 #include <inttypes.h>
+#include <limits.h>
 #include <string.h>
 #include <time.h>
 
@@ -121,7 +122,8 @@
     return maybe_write(out, &u8, 1) ? 1 : -1;
   }
 
-  int len = (int)strlen(buf);  // |buf| is guaranteed to be short.
+  static_assert(sizeof(buf) < INT_MAX, "len may not fit in int");
+  int len = (int)strlen(buf);
   return maybe_write(out, buf, len) ? len : -1;
 }