On Aug 31, 2005, at 11:58 AM, Andrej wrote:
After installing qmailadmin-1.2.8 on a debian stable with apache 1.3 I ended up having
Premature end of script headers: /usr/lib/cgi-bin/qmailadmin
in my apache error logfile. I could run qmailadmin from the shell just fine, so I spent hours looking for Apache config error before I started to add fprintf stderr to the source trying to locate the error. Finally I found the source within the first printf that writes the html header. For unknown reason charset was 0L and therefore *charset == '\0' crashed the cgi. Below you can find a patch of my workaround. Of course it does not answer the main question but maybe somebody of the qmailadmin wizards can bring light into this.

Here's the proper patch, it's already in 1.2.9, I just need to get around to releasing it.

--- /tmp/qmailadmin.c   2005-08-08 13:49:24.589751473 -0700
+++ qmailadmin.c        2005-08-08 13:49:11.176807056 -0700
@@ -304,6 +304,7 @@
   size_t bytes_read;
   char *lang_entries;
   char *id;
+  char *p;

   open_lang (lang);
   fseek (lang_fs, 0, SEEK_END);
@@ -318,7 +319,9 @@

   id = strtok (lang_entries, " \t");
   while (id) {
-    html_text[atoi(id)] = strtok (NULL, "\n");
+    p = strtok (NULL, "\n");
+    if (p == NULL) break;
+    html_text[atoi(id)] = p;
     id = strtok (NULL, " \t");
   }


--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
You don't need a laptop to troubleshoot high-speed Internet: sniffter.com

Reply via email to