Index: third_party/harfbuzz-ng/src/hb-blob.cc |
diff --git a/third_party/harfbuzz-ng/src/hb-blob.cc b/third_party/harfbuzz-ng/src/hb-blob.cc |
index b82b4b2a3a3f80de0b3e0484b7b95a75140a9b3f..8759a252a57cc6088aced8762867bcd1a93d84a7 100644 |
--- a/third_party/harfbuzz-ng/src/hb-blob.cc |
+++ b/third_party/harfbuzz-ng/src/hb-blob.cc |
@@ -78,8 +78,8 @@ _hb_blob_destroy_user_data (hb_blob_t *blob) |
} |
/** |
- * hb_blob_create: (Xconstructor) |
- * @data: (array length=length) (closure user_data) (destroy destroy) (scope notified) (transfer none): Pointer to blob data. |
+ * hb_blob_create: (skip) |
+ * @data: Pointer to blob data. |
* @length: Length of @data in bytes. |
* @mode: Memory mode for @data. |
* @user_data: Data parameter to pass to @destroy. |
@@ -102,7 +102,10 @@ hb_blob_create (const char *data, |
{ |
hb_blob_t *blob; |
- if (!length || !(blob = hb_object_create<hb_blob_t> ())) { |
+ if (!length || |
+ length >= 1u << 31 || |
+ data + length < data /* overflows */ || |
+ !(blob = hb_object_create<hb_blob_t> ())) { |
if (destroy) |
destroy (user_data); |
return hb_blob_get_empty (); |