Subject: bad diagassert in citrus iconv
To: None <tech-userlevel@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-userlevel
Date: 03/12/2005 00:14:35
--3V7upXqbjpZ4EhLz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi all,
attached patch fixes an diag assertion which matches neither the
actual code checks nor the standard requirements for iconv.

Joerg

@Christos: Sorry for not using send-pr, but the web interface sucks.

--3V7upXqbjpZ4EhLz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="citrus_iconv.h.diff"

Index: citrus_iconv.h
===================================================================
RCS file: /home/joerg/wd/repository/netbsd/src/lib/libc/citrus/citrus_iconv.h,v
retrieving revision 1.3
diff -u -r1.3 citrus_iconv.h
--- citrus_iconv.h	10 Jul 2003 08:50:43 -0000	1.3
+++ citrus_iconv.h	11 Mar 2005 23:02:09 -0000
@@ -59,7 +59,7 @@
 {
 
 	_DIAGASSERT(cv && cv->cv_shared && cv->cv_shared->ci_ops &&
-		    cv->cv_shared->ci_ops->io_convert && out);
+		    cv->cv_shared->ci_ops->io_convert && (out || !outbytes));
 
 	return (*cv->cv_shared->ci_ops->io_convert)(cv, in, inbytes, out,
 						    outbytes, flags, nresults);

--3V7upXqbjpZ4EhLz--