From 2e715f392c1035aed89b6d98720c55cf7a2a77e9 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 23 Jul 2025 18:46:54 -0700 Subject: [PATCH] Fix Blob_t vs ContactBlob type differences These structs are defined differently with a potentially different memory layouts so they cannot be treated as the same. --- jp-contact.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jp-contact.c b/jp-contact.c index 1d02ef2..2e4a3c8 100644 --- a/jp-contact.c +++ b/jp-contact.c @@ -56,7 +56,11 @@ int jp_pack_Contact(struct Contact *c, pi_buffer_t *buf) int jp_Contact_add_blob(struct Contact *c, Blob_t *blob) { - return Contact_add_blob(c, blob); + struct ContactBlob cblob; + memcpy(cblob.type, blob->type, sizeof(cblob.type)); + cblob.length = blob->length; + cblob.data = blob->data; + return Contact_add_blob(c, &cblob); } int jp_Contact_add_picture(struct Contact *c, struct ContactPicture *p)