Commit 809cc404 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Fixed crash if file-authTag or file-key is empty in file transfer content

parent 7c23abce
......@@ -584,6 +584,7 @@ static void fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml (FileTran
// There is a key in the msg: file has been encrypted.
// Convert the key from base 64.
xmlChar *keyb64 = xmlNodeListGetString(xmlMessageBody, cur->xmlChildrenNode, 1);
if (keyb64) {
size_t keyb64Length = strlen(reinterpret_cast<char *>(keyb64));
size_t keyLength;
......@@ -598,10 +599,12 @@ static void fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml (FileTran
xmlFree(keyb64);
free(keyBuffer);
}
}
if (!xmlStrcmp(cur->name, (const xmlChar *)"file-authTag")) {
// There is authentication tag in the msg: file has been encrypted.
// Convert the tag from base 64.
xmlChar *authTagb64 = xmlNodeListGetString(xmlMessageBody, cur->xmlChildrenNode, 1);
if (authTagb64) {
size_t authTagb64Length = strlen(reinterpret_cast<char *>(authTagb64));
size_t authTagLength;
......@@ -616,6 +619,7 @@ static void fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml (FileTran
xmlFree(authTagb64);
free(authTagBuffer);
}
}
cur = cur->next;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment