From e2d152f104dcaaecb53fa988b84c2f925d010125 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 3 Nov 2015 15:51:02 +0000 Subject: [PATCH] Prevented potential NULL pointer dereference. Coverity CID 28759. --- xorriso/findjob.c | 7 ++++--- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xorriso/findjob.c b/xorriso/findjob.c index 509b4180..0fa8721c 100644 --- a/xorriso/findjob.c +++ b/xorriso/findjob.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2014 Thomas Schmitt, + Copyright 2007-2015 Thomas Schmitt, Provided under GPL version 2 or later. @@ -464,7 +464,7 @@ int Findjob_new_node(struct FindjoB *job, struct ExprnodE **fnode, char *origin, int flag) /* bit0= open new branch - bit1= with bit1 : do not register as sub-node of job->cursor + bit1= with bit0 : do not register as sub-node of job->cursor */ { int ret; @@ -489,7 +489,8 @@ int Findjob_new_node(struct FindjoB *job, struct ExprnodE **fnode, job->cursor->sub= f; } } else { - f->up= job->cursor->up; + if(job->cursor != NULL) + f->up= job->cursor->up; f->left= job->cursor; if(job->cursor!=NULL) job->cursor->right= f; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 3cac7759..fcb26ebf 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2015.11.03.154102" +#define Xorriso_timestamP "2015.11.03.155015"