From: Joerg Schilling Date: Wed, 4 Apr 2018 14:23:49 +0200 Message-Id: <5ac4c3d5.KoDNJ6KE385qa01k%Joerg.Schilling@fokus.fraunhofer.de> --- /tmp/sccs.qiaqyV 2018-01-25 20:32:44.873172000 +0100 +++ joliet.c 2018-04-04 14:17:50.101534000 +0200 From: Jan Engelhardt Date: Wed, 4 Apr 2018 14:08:35 +0200 (CEST) Message-ID: Can't call strlen(source) when source==NULL. Shouldn't call strlen(source) before checking source==NULL. --- mkisofs/joliet.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) Index: schily-2018-03-16/mkisofs/joliet.c =================================================================== --- schily-2018-03-16.orig/mkisofs/joliet.c +++ schily-2018-03-16/mkisofs/joliet.c @@ -258,13 +258,6 @@ convert_to_unicode(buffer, size, source, int jsize; /* - * joliet_strlen() behaves the same way: Stop at the first nul byte. - * Note: we cannot have 16 bit character representations in the source - * encoding, if we like strlen() to work correctly. - */ - jsize = strlen(source); - - /* * If we get a NULL pointer for the source, it means we have an * inplace copy, and we need to make a temporary working copy first. */ @@ -276,6 +269,13 @@ convert_to_unicode(buffer, size, source, } /* + * joliet_strlen() behaves the same way: Stop at the first nul byte. + * Note: we cannot have 16 bit character representations in the source + * encoding, if we like strlen() to work correctly. + */ + jsize = strlen(tmpbuf); + + /* * Now start copying characters. If the size was specified to be 0, * then assume the input was 0 terminated. */