rem: glen = len + (len / 100) + 13 + sizeof(header) + sizeof(footer);
add: glen = compressBound(len) + sizeof(header) + sizeof(footer);
context: Ns_Compress(char *buf, int len, Tcl_DString *outPtr, int level){#ifndef HAVE_LIBZ    return NS_ERROR;#else    uLongf glen;    char *gbuf;    uLong crc;    int skip;    uint32_t footer[2];    /*     * Grow buffer for header, footer, and maximum compressed size.     */    glen = len + (len / 100) + 13 + sizeof(header) + sizeof(footer);    Tcl_DStringSetLength(outPtr, (int) glen);    /*     * Compress output starting 2-bytes from the end of the header.      */    gbuf = outPtr->string;    skip = sizeof(header) - 2;    glen -= skip;    if (compress2(gbuf + skip, &glen, buf, (uLong) len, level) != Z_OK) {        return NS_ERROR;    }    memcpy(gbuf, header, sizeof(header));    Tcl_DStringSetLength(outPtr, (int) glen + skip);    /*     * Append footer of CRC and uncompressed length.     */    crc = crc32(0, Z_NULL, 0);    crc = crc32(crc, buf, (uInt) len);    footer[0] = htonl(crc);    footer[1] = htonl(len);    Tcl_DStringAppend(outPtr, (char *) footer, sizeof(footer));    return NS_OK;#endif}