From 573db774ae37e832d2146e2db48a085be89a4c1b Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 6 Feb 2020 09:19:24 +0000 Subject: remove unnecessary assert() check (from S. Hirata) git-svn-id: svn://tug.org/texlive/trunk@53690 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/ChangeLog | 9 +++++++++ Build/source/texk/dvipdfm-x/pdfobj.c | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index db3de86ee15..395a88b458c 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,12 @@ +2020-02-06 Shunsaku Hirata + + * pdfobj.c: In pdf_new_string(), the supplied string was + checked and dvipdfmx aborted when it was NULL. This check + is removed since it is actually not necessary. The string is + regarded simply as an empty string if it is NULL from now on. + See https://tex.stackexchange.com/questions/522794/problem-in-updated-tex-live, + although we can't reproduce the problem. + 2020-01-24 Akira Kakuto * dvi.c: Forgot to null-terminate strings in the previous diff --git a/Build/source/texk/dvipdfm-x/pdfobj.c b/Build/source/texk/dvipdfm-x/pdfobj.c index 50246fc7ede..fc977d2a06f 100644 --- a/Build/source/texk/dvipdfm-x/pdfobj.c +++ b/Build/source/texk/dvipdfm-x/pdfobj.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2019 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2020 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks @@ -938,20 +938,20 @@ pdf_new_string (const void *str, unsigned length) pdf_obj *result; pdf_string *data; - ASSERT(str); - result = pdf_new_obj(PDF_STRING); data = NEW(1, pdf_string); result->data = data; data->length = length; - if (length) { + if (str && length > 0) { data->string = NEW(length+1, unsigned char); memcpy(data->string, str, length); /* Shouldn't assume NULL terminated. */ data->string[length] = '\0'; - } else + } else { data->string = NULL; + data->length = 0; + } return result; } -- cgit v1.2.3