Skip to content

Commit

Permalink
fixup! pk11_uri: copy uri to new buffer with terminating null
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Wernli committed Feb 20, 2024
1 parent c487a49 commit a1f187a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ static char *obj_uri_get1(P11PROV_PK11_URI *obj)
P11PROV_debug("Failed to get URI");
return NULL;
}
return p11prov_alloc_sprintf(uri_len, "%s", uri);
char *null_terminated_uri = OPENSSL_zalloc(uri_len + 1);
memcpy(null_terminated_uri, uri, uri_len);
return null_terminated_uri;
}

struct desired_data_type_cbdata {
Expand Down

0 comments on commit a1f187a

Please sign in to comment.