Index: lib/ratDSN.c =================================================================== RCS file: /usr/site/share/cvsroot/ratatosk/lib/Attic/ratDSN.c,v retrieving revision 1.41.2.1 diff -u -r1.41.2.1 ratDSN.c --- lib/ratDSN.c 17 Feb 2003 16:52:12 -0000 1.41.2.1 +++ lib/ratDSN.c 5 Nov 2003 12:36:20 -0000 @@ -89,7 +89,7 @@ RatDSNStartMessage(Tcl_Interp *interp, const char *id, const char *subject) { Tcl_DString *dsPtr = (Tcl_DString*)ckalloc(sizeof(Tcl_DString)); - char buf[32], *header, *cPtr; + unsigned char buf[32], *header, *cPtr; time_t seconds; Tcl_DStringInit(dsPtr); @@ -97,9 +97,11 @@ seconds = time(NULL); sprintf(buf, "%d", (int)seconds); Tcl_DStringAppendElement(dsPtr, buf); - cPtr = header = RatDecodeHeader(interp, subject, 0); - while ((cPtr = strchr(cPtr, '\n'))) { - *cPtr++ = ' '; + header = RatDecodeHeader(interp, subject, 0); + for (cPtr = header; *cPtr; cPtr++) { + if (*cPtr < 32) { + *cPtr = ' '; + } } Tcl_DStringAppendElement(dsPtr, header); Tcl_DStringStartSublist(dsPtr); @@ -258,6 +260,13 @@ Tcl_GetIntFromObj(interp, oPtr, &perm); dir = RatGetPathOption(interp, "dsn_directory"); while (linePtr = Tcl_NewObj(), -1 != Tcl_GetsObj(channel, linePtr)) { + /* Join lines until we have a valid list */ + while (0 != Tcl_ListObjLength(interp, linePtr, &i) + && -1 != Tcl_GetsObj(channel, linePtr)); + if (i != 4) { + /* If the list does not have 4 elements it is invalid */ + continue; + } if (RatDSNExpire(interp, linePtr)) { /* * This DSN has expired so we should remove all associated files