fix use of uninitialized value

This commit is contained in:
wang--ge 2021-06-15 16:17:30 +08:00
parent b3c3903d84
commit 00e14a0442
2 changed files with 25 additions and 1 deletions

View File

@ -1,12 +1,13 @@
Name: LibRaw
Version: 0.20.2
Release: 3
Release: 4
Summary: Library for reading RAW files obtained from digital photo cameras
License: BSD and (CDDL or LGPLv2)
URL: http://www.libraw.org
Source0: http://github.com/LibRaw/LibRaw/archive/%{version}.tar.gz
Patch0000: prevent-buffer-overrun-in-parse_rollei.patch
Patch0001: fix-stack-buffer-overflow-in-LibRaw_buffer_datastream_gets.patch
Patch0002: fix-use-of-uninitialized-value.patch
BuildRequires: gcc-c++ pkgconfig(lcms2) pkgconfig(libjpeg)
BuildRequires: autoconf automake libtool
Provides: bundled(dcraw) = 9.25
@ -67,6 +68,9 @@ rm -rfv samples/.deps samples/.dirstamp samples/*.o
%exclude %{_docdir}/libraw/*
%changelog
* Thu Jun 3 2021 zhangjiapeng <zhangjiapeng9@huawei.com> - 0.20.2-4
- fix use of uninitialized value
* Sat Dec 5 2020 leiju <leiju4@huawei.com> - 0.20.2-3
- modify Patch0001 name to fix patch parse error

View File

@ -0,0 +1,20 @@
diff --git a/src/metadata/sony.cpp b/src/metadata/sony.cpp
index 120340b..2e8dd49 100644
--- a/src/metadata/sony.cpp
+++ b/src/metadata/sony.cpp
@@ -1071,6 +1071,7 @@ void LibRaw::parseSonyMakernotes(
(len >= 196))
{
table_buf = (uchar *)malloc(len);
+ memset(table_buf,0,len);
fread(table_buf, len, 1, ifp);
lid = 0x01 << 2;
@@ -1106,6 +1107,7 @@ void LibRaw::parseSonyMakernotes(
(len >= 227))
{
table_buf = (uchar *)malloc(len);
+ memset(table_buf,0,len);
fread(table_buf, len, 1, ifp);
lid = 0x0;