Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a8986c2c
Kaydet (Commit)
a8986c2c
authored
Eyl 05, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
CID#736586: fix memory leaks
Change-Id: I02a10b8b0d18334ce693d0cead0b81d34b4eeeac
üst
d73c039f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
pdfwriter_impl.cxx
vcl/source/gdi/pdfwriter_impl.cxx
+8
-8
No files found.
vcl/source/gdi/pdfwriter_impl.cxx
Dosyayı görüntüle @
a8986c2c
...
...
@@ -73,6 +73,8 @@
#include "cppuhelper/implbase1.hxx"
#include <boost/scoped_array.hpp>
#if !defined(ANDROID) && !defined(IOS)
// NSS header files for PDF signing support
#include "nss.h"
...
...
@@ -6003,26 +6005,24 @@ bool PDFWriterImpl::finalizeSignature()
HASH_Begin(hc.get());
char *buffer = new char[m_nSignatureContentOffset + 1]
;
boost::scoped_array<char> buffer(new char[m_nSignatureContentOffset + 1])
;
sal_uInt64 bytesRead;
//FIXME: Check if SHA1 is calculated from the correct byterange
CHECK_RETURN( (osl_File_E_None == osl_readFile( m_aFile, buffer, m_nSignatureContentOffset - 1 , &bytesRead ) ) );
CHECK_RETURN( (osl_File_E_None == osl_readFile( m_aFile, buffer
.get()
, m_nSignatureContentOffset - 1 , &bytesRead ) ) );
if (bytesRead != (sal_uInt64)m_nSignatureContentOffset - 1)
SAL_WARN("vcl.gdi", "PDF Signing: First buffer read failed!");
HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer), bytesRead);
delete[] buffer;
HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer.get()), bytesRead);
CHECK_RETURN( (osl_File_E_None == osl_setFilePos( m_aFile, osl_Pos_Absolut, m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1) ) );
buffer
= new char[nLastByteRangeNo + 1]
;
CHECK_RETURN( (osl_File_E_None == osl_readFile( m_aFile, buffer, nLastByteRangeNo, &bytesRead ) ) );
buffer
.reset(new char[nLastByteRangeNo + 1])
;
CHECK_RETURN( (osl_File_E_None == osl_readFile( m_aFile, buffer
.get()
, nLastByteRangeNo, &bytesRead ) ) );
if (bytesRead != (sal_uInt64) nLastByteRangeNo)
SAL_WARN("vcl.gdi", "PDF Signing: Second buffer read failed!");
HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer), bytesRead);
delete[] buffer;
HASH_Update(hc.get(), reinterpret_cast<const unsigned char*>(buffer.get()), bytesRead);
SECItem digest;
unsigned char hash[SHA1_LENGTH];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment