[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:41:10 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=ade0b51
The following commit has been merged in the master branch:
commit ade0b51b7935e3cc57f11406a92b4689d108ba49
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Mon Feb 15 09:25:25 2010 +0000
#671: Fixed error handling for read-only files.
---
src/basicio.cpp | 8 ++++++--
src/error.cpp | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/basicio.cpp b/src/basicio.cpp
index cf5d038..2bf7cf7 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -297,7 +297,9 @@ namespace Exiv2 {
}
p_->mappedLength_ = size();
p_->isWriteable_ = isWriteable;
- if (p_->isWriteable_ && p_->switchMode(Impl::opWrite) != 0) return 0;
+ if (p_->isWriteable_ && p_->switchMode(Impl::opWrite) != 0) {
+ throw Error(16, path(), strError());
+ }
#if defined EXV_HAVE_MMAP && defined EXV_HAVE_MUNMAP
int prot = PROT_READ;
if (p_->isWriteable_) {
@@ -343,7 +345,9 @@ namespace Exiv2 {
#else
// Workaround for platforms without mmap: Read the file into memory
DataBuf buf(static_cast<long>(p_->mappedLength_));
- read(buf.pData_, buf.size_);
+ if (read(buf.pData_, buf.size_) != buf.size_) {
+ throw Error(2, path(), strError(), "FileIo::read");
+ }
if (error() || eof()) throw Error(2, path(), strError(), "FileIo::mmap");
p_->pMappedArea_ = buf.release().first;
p_->isMalloced_ = true;
diff --git a/src/error.cpp b/src/error.cpp
index 0298313..b7ca49e 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -67,7 +67,7 @@ namespace {
{ 13, N_("Image type %1 is not supported") }, // %1=image type
{ 14, N_("Failed to read image data") },
{ 15, N_("This does not look like a JPEG image") },
-// { 16, N_("") }, -- currently not used
+ { 16, N_("%1: Failed to map file for reading and writing: %2") }, // %1=path, %2=strerror
{ 17, N_("%1: Failed to rename file to %2: %3") }, // %1=old path, %2=new path, %3=strerror
{ 18, N_("%1: Transfer failed: %2") }, // %1=path, %2=strerror
{ 19, N_("Memory transfer failed: %1") }, // %1=strerror
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list