grafx2: add some checks

This commit is contained in:
Jerome Duval
2021-03-30 11:02:32 +02:00
parent 3780b7ecfb
commit c0e97efb0c
2 changed files with 33 additions and 1 deletions

View File

@@ -8,12 +8,13 @@ HOMEPAGE="http://grafx2.tk"
COPYRIGHT="1995-2001 Sunset Design
2007-2021 GrafX2 project team"
LICENSE="GNU GPL v2"
REVISION="1"
REVISION="2"
GITREV="8e2d28b5cfd0e3220ce4c5b38be8d0f3af650c89"
SOURCE_URI="https://gitlab.com/GrafX2/grafX2/-/archive/${GITREV}/grafX2-${GITREV}.tar.bz2"
SOURCE_FILENAME="grafx2-2.8-${GITREV}.tar.gz"
SOURCE_DIR="grafX2-${GITREV}"
CHECKSUM_SHA256="21320e7d82eb3c6881dc2a4e9ae37e579eecd703d31dbb172cc881220a115dd2"
PATCHES="grafx2-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"

View File

@@ -0,0 +1,31 @@
From b616fdb35baf79ece153b70ca3613d57dee212de Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 30 Mar 2021 10:59:41 +0200
Subject: add checks in Extract_path
diff --git a/src/io.c b/src/io.c
index ab64904..30da356 100644
--- a/src/io.c
+++ b/src/io.c
@@ -353,6 +353,17 @@ char * Extract_path(char *dest, const char *source)
char * position;
char * path;
+ if (dest == NULL)
+ {
+ GFX2_Log(GFX2_ERROR, "Extract_path() dest is null !\n");
+ return NULL;
+ }
+ if (source == NULL)
+ {
+ GFX2_Log(GFX2_ERROR, "Extract_path() source is null !\n");
+ return NULL;
+ }
+
path = Realpath(source, dest);
if (path == NULL)
{
--
2.30.0