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
1f08711b
Kaydet (Commit)
1f08711b
authored
Eyl 02, 2012
tarafından
Arnaud Versini
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace usage of rtl/memory.h in PDF Import with equivalent from string.h
Change-Id: I13f88bdfa6fc7d2b39fb2fd6a686b5364c20d6b5
üst
fc971580
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
filterdet.cxx
sdext/source/pdfimport/filterdet.cxx
+3
-2
pdfentries.cxx
sdext/source/pdfimport/pdfparse/pdfentries.cxx
+14
-13
pdfparse.cxx
sdext/source/pdfimport/pdfparse/pdfparse.cxx
+2
-2
No files found.
sdext/source/pdfimport/filterdet.cxx
Dosyayı görüntüle @
1f08711b
...
...
@@ -49,6 +49,7 @@
#include <com/sun/star/io/TempFile.hpp>
#include <boost/scoped_ptr.hpp>
#include <string.h>
using
namespace
com
::
sun
::
star
;
...
...
@@ -256,7 +257,7 @@ bool FileEmitContext::write( const void* pBuf, unsigned int nLen )
return
false
;
uno
::
Sequence
<
sal_Int8
>
aSeq
(
nLen
);
rtl_copyMemor
y
(
aSeq
.
getArray
(),
pBuf
,
nLen
);
memcp
y
(
aSeq
.
getArray
(),
pBuf
,
nLen
);
m_xOut
->
writeBytes
(
aSeq
);
return
true
;
}
...
...
@@ -560,7 +561,7 @@ bool checkDocChecksum( const rtl::OUString& rInPDFFileURL,
// open file and calculate actual checksum up to index nBytes
sal_uInt8
nActualChecksum
[
RTL_DIGEST_LENGTH_MD5
];
rtl_zeroMemory
(
nActualChecksum
,
sizeof
(
nActualChecksum
)
);
memset
(
nActualChecksum
,
0
,
sizeof
(
nActualChecksum
)
);
rtlDigest
aActualDigest
=
rtl_digest_createMD5
();
oslFileHandle
aRead
=
NULL
;
oslFileError
aErr
=
osl_File_E_None
;
...
...
sdext/source/pdfimport/pdfparse/pdfentries.cxx
Dosyayı görüntüle @
1f08711b
...
...
@@ -46,6 +46,7 @@
#include <map>
#include <stdio.h>
#include <string.h>
using
::
rtl
::
OUString
;
using
::
rtl
::
OString
;
...
...
@@ -1059,9 +1060,9 @@ struct PDFFileImplData
m_aCipher
(
NULL
),
m_aDigest
(
NULL
)
{
rtl_zeroMemory
(
m_aOEntry
,
sizeof
(
m_aOEntry
)
);
rtl_zeroMemory
(
m_aUEntry
,
sizeof
(
m_aUEntry
)
);
rtl_zeroMemory
(
m_aDecryptionKey
,
sizeof
(
m_aDecryptionKey
)
);
memset
(
m_aOEntry
,
0
,
sizeof
(
m_aOEntry
)
);
memset
(
m_aUEntry
,
0
,
sizeof
(
m_aUEntry
)
);
memset
(
m_aDecryptionKey
,
0
,
sizeof
(
m_aDecryptionKey
)
);
}
~
PDFFileImplData
()
...
...
@@ -1132,7 +1133,7 @@ static void pad_or_truncate_to_32( const OString& rStr, sal_Char* pBuffer )
if
(
nLen
>
32
)
nLen
=
32
;
const
sal_Char
*
pStr
=
rStr
.
getStr
();
rtl_copyMemor
y
(
pBuffer
,
pStr
,
nLen
);
memcp
y
(
pBuffer
,
pStr
,
nLen
);
int
i
=
0
;
while
(
nLen
<
32
)
pBuffer
[
nLen
++
]
=
nPadString
[
i
++
];
...
...
@@ -1170,7 +1171,7 @@ static sal_uInt32 password_to_key( const OString& rPwd, sal_uInt8* pOutKey, PDFF
sal_uInt32
nLen
=
pData
->
m_nKeyLength
;
if
(
nLen
>
RTL_DIGEST_LENGTH_MD5
)
nLen
=
RTL_DIGEST_LENGTH_MD5
;
rtl_copyMemor
y
(
pOutKey
,
nSum
,
nLen
);
memcp
y
(
pOutKey
,
nSum
,
nLen
);
return
nLen
;
}
...
...
@@ -1180,10 +1181,10 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
bool
bValid
=
false
;
sal_uInt8
aKey
[
ENCRYPTION_KEY_LEN
];
sal_uInt8
nEncryptedEntry
[
ENCRYPTION_BUF_LEN
];
rtl_zeroMemory
(
nEncryptedEntry
,
sizeof
(
nEncryptedEntry
)
);
memset
(
nEncryptedEntry
,
0
,
sizeof
(
nEncryptedEntry
)
);
sal_uInt32
nKeyLen
=
password_to_key
(
rPwd
,
aKey
,
pData
,
false
);
// save (at this time potential) decryption key for later use
rtl_copyMemor
y
(
pData
->
m_aDecryptionKey
,
aKey
,
nKeyLen
);
memcp
y
(
pData
->
m_aDecryptionKey
,
aKey
,
nKeyLen
);
if
(
pData
->
m_nStandardRevision
==
2
)
{
// see PDF reference 1.4 Algorithm 3.4
...
...
@@ -1193,7 +1194,7 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
NULL
,
0
);
rtl_cipher_encodeARCFOUR
(
pData
->
m_aCipher
,
nPadString
,
sizeof
(
nPadString
),
nEncryptedEntry
,
sizeof
(
nEncryptedEntry
)
);
bValid
=
(
rtl_compareMemory
(
nEncryptedEntry
,
pData
->
m_aUEntry
,
32
)
==
0
);
bValid
=
(
memcmp
(
nEncryptedEntry
,
pData
->
m_aUEntry
,
32
)
==
0
);
}
else
if
(
pData
->
m_nStandardRevision
==
3
)
{
...
...
@@ -1218,7 +1219,7 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
nEncryptedEntry
,
16
,
nEncryptedEntry
,
16
);
// encrypt in place
}
bValid
=
(
rtl_compareMemory
(
nEncryptedEntry
,
pData
->
m_aUEntry
,
16
)
==
0
);
bValid
=
(
memcmp
(
nEncryptedEntry
,
pData
->
m_aUEntry
,
16
)
==
0
);
}
return
bValid
;
}
...
...
@@ -1250,7 +1251,7 @@ bool PDFFile::setupDecryptionData( const OString& rPwd ) const
// see PDF reference 1.4 Algorithm 3.7
sal_uInt8
aKey
[
ENCRYPTION_KEY_LEN
];
sal_uInt8
nPwd
[
ENCRYPTION_BUF_LEN
];
rtl_zeroMemory
(
nPwd
,
sizeof
(
nPwd
)
);
memset
(
nPwd
,
0
,
sizeof
(
nPwd
)
);
sal_uInt32
nKeyLen
=
password_to_key
(
rPwd
,
aKey
,
m_pData
,
true
);
if
(
m_pData
->
m_nStandardRevision
==
2
)
{
...
...
@@ -1262,7 +1263,7 @@ bool PDFFile::setupDecryptionData( const OString& rPwd ) const
}
else
if
(
m_pData
->
m_nStandardRevision
==
3
)
{
rtl_copyMemor
y
(
nPwd
,
m_pData
->
m_aOEntry
,
32
);
memcp
y
(
nPwd
,
m_pData
->
m_aOEntry
,
32
);
for
(
int
i
=
19
;
i
>=
0
;
i
--
)
{
sal_uInt8
nTempKey
[
ENCRYPTION_KEY_LEN
];
...
...
@@ -1381,7 +1382,7 @@ PDFFileImplData* PDFFile::impl_getData() const
{
OString
aEnt
=
pString
->
getFilteredString
();
if
(
aEnt
.
getLength
()
==
32
)
rtl_copyMemor
y
(
m_pData
->
m_aOEntry
,
aEnt
.
getStr
(),
32
);
memcp
y
(
m_pData
->
m_aOEntry
,
aEnt
.
getStr
(),
32
);
#if OSL_DEBUG_LEVEL > 1
else
{
...
...
@@ -1400,7 +1401,7 @@ PDFFileImplData* PDFFile::impl_getData() const
{
OString
aEnt
=
pString
->
getFilteredString
();
if
(
aEnt
.
getLength
()
==
32
)
rtl_copyMemor
y
(
m_pData
->
m_aUEntry
,
aEnt
.
getStr
(),
32
);
memcp
y
(
m_pData
->
m_aUEntry
,
aEnt
.
getStr
(),
32
);
#if OSL_DEBUG_LEVEL > 1
else
{
...
...
sdext/source/pdfimport/pdfparse/pdfparse.cxx
Dosyayı görüntüle @
1f08711b
...
...
@@ -41,7 +41,7 @@
#include <boost/spirit/include/classic_error_handling.hpp>
#include <boost/spirit/include/classic_file_iterator.hpp>
#include <boost/bind.hpp>
#include <string>
#include <string
.h
>
#include <rtl/strbuf.hxx>
#include <rtl/memory.h>
...
...
@@ -79,7 +79,7 @@ class StringEmitContext : public EmitContext
{
if
(
nOrigOffset
+
nLen
<
static_cast
<
unsigned
int
>
(
m_aBuf
.
getLength
())
)
{
rtl_copyMemor
y
(
pBuf
,
m_aBuf
.
getStr
()
+
nOrigOffset
,
nLen
);
memcp
y
(
pBuf
,
m_aBuf
.
getStr
()
+
nOrigOffset
,
nLen
);
return
nLen
;
}
return
0
;
...
...
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