[cups] cupsd 2.0.3 SIGSEGV on Solaris SPARC 64bit

Matthias Apitz guru at unixarea.de
Fri Jan 22 11:53:35 PST 2016


El día Friday, January 22, 2016 a las 11:50:40AM -0500, Michael Sweet escribió:

> Matthias,
> 
> The backtrace shows a NULL content type being logged, and Solaris' vsnprintf function doesn't handle NULL string pointers like it should (namely, substituting "(null)" for a crash).  This is a side-effect of not supporting modern POSIX and C99 standards... :/
> 

Michael,

This is really a nice story! Our library application suite was written,
starting in the end of the 1980', in C for the first UNIX workstations
of the company Siemens (the MX300 with NSC processors), later ported to
MX300/Intel and MIPS RM600, all made by Siemens, or Siemens/Nixdorff. On all
these systems it was allowed to dereference a NULL pointer, which virtually
just pointed to a null terminated empty string, i.e. strlen(NULL) gave 0;
Around 1995 I ported the full suite (millions of lines of code) to SunOS 5.6 (IIRC).
There a NULL pointer dereference gave what it should give: SIGSEGV. It
took me months to eliminate all those bugs or writing wrappers for the
str*() functions to check the args against NULL. Well, and now you come
here and say this, read access to a NULL pointer should give something
like "(null)", is state of the modern arts and standards ... nice story
after 20 years of coding against NULL pointers :-)

Btw: I think (I'm not a Java programmer), even Java throws an exception
on dereference of a NULL pointer.

> Newer CUPS releases use their own vsnprintf implementation to avoid this issue on Solaris and other legacy platforms...
> 
> (so the solution here is to update to CUPS 2.1.0 or later)

Thanks, I will see what I can do. I saw already in 2.0.3 a test against
HAVE_VSNPRINTF, and if not using a define

# define vsnprintf _cups_vsnprintf

Maybe it's enough to disable HAVE_VSNPRINTF after configure run...

Thanks for your help in any case.

	matthias


-- 
Matthias Apitz, ✉ guru at unixarea.de, ⌂ http://www.unixarea.de/  ☎ +49-176-38902045
UNIX since V7 on PDP-11 | UNIX on mainframe since ESER 1055 (IBM /370)
UNIX on x86 since SVR4.2 UnixWare 2.1.2 | FreeBSD since 2.2.5



More information about the cups mailing list