From 0186c1817bd1503051597dbcf0b032d4ff1277ab Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 1 Aug 2017 16:20:40 -0400 Subject: Remove support for negative params to ReleaseBuffer() This CL removes the default param value for this method, which was negative. It also adds in a method to get buffer lengths, so that the callsites can explictly passing in the length of the buffer if they were using the default value previously. BUG=pdfium:828 Change-Id: I0170771ee81970b8b601631015ab3e6e39fea8ea Reviewed-on: https://pdfium-review.googlesource.com/9790 Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/fpdfxfa') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp index 7cccd2fb11..c12314f88d 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp +++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp @@ -976,11 +976,11 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc, (FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength()); FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength()); pFormFillEnv->EmailTo(pFileHandler, pTo, pSubject, pCC, pBcc, pMsg); - bsTo.ReleaseBuffer(); - bsCC.ReleaseBuffer(); - bsBcc.ReleaseBuffer(); - bsSubject.ReleaseBuffer(); - bsMsg.ReleaseBuffer(); + bsTo.ReleaseBuffer(bsTo.GetStringLength()); + bsCC.ReleaseBuffer(bsCC.GetStringLength()); + bsBcc.ReleaseBuffer(bsBcc.GetStringLength()); + bsSubject.ReleaseBuffer(bsSubject.GetStringLength()); + bsMsg.ReleaseBuffer(bsMsg.GetStringLength()); } else { // HTTP or FTP CFX_WideString ws; -- cgit v1.2.3