Index: core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp |
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp |
index 2672116e4fb3d3be02bd9caf197b18e9da486609..9985f06dc6e6eed97cb01763e97e1cf0be11df91 100644 |
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp |
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp |
@@ -543,8 +543,7 @@ static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest) |
SInt32 len = CFStringGetLength(src); |
CFRange range = CFRangeMake(0, len); |
CFIndex used = 0; |
- UInt8* pBuffer = (UInt8*)malloc(sizeof(UInt8) * (len + 1)); |
- FXSYS_memset32(pBuffer, 0, sizeof(UInt8) * (len + 1)); |
+ UInt8* pBuffer = (UInt8*)calloc(len+1, sizeof(UInt8)); |
CFStringGetBytes(src, range, kCFStringEncodingASCII, 0, false, pBuffer, len, &used); |
dest = (FX_LPSTR)pBuffer; |
free(pBuffer); |