From: Richard Huang Date: Fri, 10 Jan 2020 15:09:23 +0000 (+0000) Subject: Fix svg memory issue X-Git-Tag: dali_1.4.54~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F222228%2F1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Fix svg memory issue - fix heap-buffer-overflow issue - nsvgParse : Parses SVG file from a null terminated string Change-Id: Ie462dd63b03ba212b5e67c89406fb477f83f0692 --- diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.cpp b/dali-toolkit/internal/visuals/svg/svg-visual.cpp index a3d3685..fccd5e7 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -208,6 +208,7 @@ void SvgVisual::ParseFromUrl( const VisualUrl& imageUrl ) Dali::Vector buffer; if ( Dali::FileLoader::ReadFile( mImageUrl.GetUrl(), buffer ) ) { + buffer.PushBack( '\0' ); mParsedImage = nsvgParse( buffer.Begin(), UNITS, meanDpi ); } }