I am trying to collect the binary checksum of a package using solvable_lookup_bin_checksum() of libsolv library. But I am not sure how to find the returned unsigned character string length as it contains binary data and it is not NULL terminated(Cannot use tradition string.c function).
Attaching my code snippet I am trying to copy the return string in other unsigned char string, but not able to get correct result because of length issue.
unsigned char *pszTemp = solvable_lookup_bin_checksum(pSolv, SOLVABLE_CHECKSUM, &checksumtype);
size_t pszTemp_size = strlen((const char*)pszTemp) + 1;
unsigned char *pszChecksum= (unsigned char *)calloc(pszTemp_size, sizeof(unsigned char));
memcpy(pszChecksum, pszTemp, pszTemp_size);
Let me know what you suggest how can we calculate the returned unsigned character string length.