Skip to content

Commit bdeed0f

Browse files
committed
IA2: IAccessible2::attribute_src: Truncate data (eg. Base64)
1 parent af65e69 commit bdeed0f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

nvdaHelper/common/ia2utils.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ void IA2AttribsToMap(const wstring &attribsString, map<wstring, wstring> &attrib
4646
// If there was no trailing semi-colon, we need to handle the last attribute.
4747
if (!key.empty())
4848
attribsMap[key] = str;
49+
// Truncate the value of "src" if it contains data (eg. Base64)
50+
map<wstring,wstring>::const_iterator attribsMapIt;
51+
if ((attribsMapIt = attribsMap.find(L"src")) != attribsMap.end()) {
52+
if (attribsMapIt->second.substr(0, 5) == L"data:") {
53+
attribsMap[L"src"] = L"data:<truncated>";
54+
}
55+
}
4956
}
5057

5158
CComPtr<IAccessibleHyperlink> HyperlinkGetter::next() {

0 commit comments

Comments
 (0)