Project

General

Profile

Bug #1325

Crash in exiv2 - Nikon1MakerNote::printBarValue (nikonnm.cpp)

Added by Thibaud Mouton almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
metadata
Target version:
Start date:
23 Nov 2017
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

I have a bug in exiv2 when accessing pictures taken with Nikon camera
with gwenview.

Basically, the problem is the Nikon1MakerNote::printBarValue which
does not check for null exifData pointer (nikonnm.cpp:298)

std::ostream& Nikon1MakerNote::printBarValue(std::ostream& os,
const Value& value,
const ExifData* exifData) {

Here is the stacktrace of the crash :

Thread 1 "gwenview" received signal SIGSEGV, Segmentation fault.
0x00007ffff0f9c1cf in Exiv2::ExifData::findKey (this=this@entry=0x0, key=...)
at /home/thibaud/work/pacman/exiv2/exiv2/repos/extra-x86_64/src/exiv2-0.26/src/exif.cpp:583
583 FindExifdatumByKey(key.key()));
(gdb) bt
#0 0x00007ffff0f9c1cf in Exiv2::ExifData::findKey
(this=this@entry=0x0, key=...)
at /home/thibaud/work/pacman/exiv2/exiv2/repos/extra-x86_64/src/exiv2-0.26/src/exif.cpp:583
#1 0x00007ffff0fd93eb in Exiv2::Internal::getKeyString (metadata=0x0,
key="Exif.MakerNote.ByteOrder", this=<optimized out>)
at /home/thibaud/work/pacman/exiv2/exiv2/repos/extra-x86_64/src/exiv2-0.26/src/nikonmn.cpp:291
#2 Exiv2::Internal::Nikon1MakerNote::printBarValue (os=...,
value=..., exifData=0x0)
at /home/thibaud/work/pacman/exiv2/exiv2/repos/extra-x86_64/src/exiv2-0.26/src/nikonmn.cpp:303
#3 0x00007ffff743987c in ?? () from /usr/lib/libgwenviewlib.so.5
#4 0x00007ffff7436809 in
Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) ()
from /usr/lib/libgwenviewlib.so.5
#5 0x00007ffff73e1398 in
Gwenview::Document::setExiv2Image(std::auto_ptr<Exiv2::Image>) () from
/usr/lib/libgwenviewlib.so.5
#6 0x00007ffff73dfcc2 in ?? () from /usr/lib/libgwenviewlib.so.5
#7 0x00007ffff73f4b1a in ?? () from /usr/lib/libgwenviewlib.so.5
#8 0x00007ffff37acc16 in QMetaObject::activate(QObject*, int, int,
void**) () from /usr/lib/libQt5Core.so.5
#9 0x00007ffff358fc03 in QFutureWatcherBase::event(QEvent*) () from
/usr/lib/libQt5Core.so.5
#10 0x00007ffff4ea0f2c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib/libQt5Widgets.so.5
#11 0x00007ffff4ea8a06 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib/libQt5Widgets.so.5
#12 0x00007ffff377d060 in QCoreApplication::notifyInternal2(QObject*,
QEvent*) () from /usr/lib/libQt5Core.so.5
#13 0x00007ffff377f8b6 in
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
()
from /usr/lib/libQt5Core.so.5
#14 0x00007ffff37d86e4 in ?? () from /usr/lib/libQt5Core.so.5
#15 0x00007fffebab9270 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
#16 0x00007fffebabaf69 in ?? () from /usr/lib/libglib-2.0.so.0
#17 0x00007fffebabafae in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#18 0x00007ffff37d7cd1 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
()
from /usr/lib/libQt5Core.so.5
#19 0x00007ffff377b48b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQt5Core.so.5
#20 0x00007ffff37844d8 in QCoreApplication::exec() () from
/usr/lib/libQt5Core.so.5
#21 0x0000555555585bc4 in ?? ()
#22 0x00007ffff2dcef6a in __libc_start_main () from /usr/lib/libc.so.6
#23 0x000055555558606a in _start ()
(gdb) up
#1 0x00007ffff0fd93eb in Exiv2::Internal::getKeyString (metadata=0x0,
key="Exif.MakerNote.ByteOrder", this=<optimized out>)
at /home/thibaud/work/pacman/exiv2/exiv2/repos/extra-x86_64/src/exiv2-0.26/src/nikonmn.cpp:291
291 if ( metadata->findKey(ExifKey(key)) != metadata->end() ) {
(gdb) p metadata
$1 = (const Exiv2::ExifData *) 0x0


Files

exiv2-fix-segfault_nikon.patch (521 Bytes) exiv2-fix-segfault_nikon.patch quick fix to avoid the crash Thibaud Mouton, 23 Nov 2017 14:45

History

#1

Updated by Thibaud Mouton almost 4 years ago

Sorry, the issue has already been fixed in the latest git branch. I was looking in the 0.26 branch.

Can then be closed

#2

Updated by Robin Mills almost 4 years ago

  • Category set to metadata
  • Status changed from New to Closed
  • Assignee set to Robin Mills
  • Priority changed from High to Normal
  • Target version set to 0.27
  • % Done changed from 0 to 100
  • Estimated time set to 1.00 h

Also available in: Atom PDF