fix for iconv related crash


Subject: fix for iconv related crash
From: Alec Wolman (wolman@cs.washington.edu)
Date: Tue Jan 02 2001 - 21:16:44 CST


When running AbiWord, I get a crash in iconv_close() called by
the XAP_EncodingManager destructor.
have been introduced by the Nov 27th checkin by "dom". Here is
the quick summary: when iconv_open fails, it returns -1 (not 0).
The destructor checks to see if the handle is non-NULL, and if
so it calls the close() routine. Thus the crash.

This problem seems to have been introduced by a checkin on Nov 27th
by Dom. My simple fix is to change all
the occurences in XAP_EncodingManager::~XAP_EncodingManager() of

  if (iconv_handle_foo)

to

  if (iconv_handle_foo != (iconv_t)-1)

Alec



This archive was generated by hypermail 2b25 : Tue Jan 02 2001 - 21:16:47 CST