- /* and fall...*/
- case ' ':
- case '\t':
- case '\n':
- putc (*cp, ce->ce_fp);
- if (digested) {
- if (*cp == '\n')
- MD5Update (&mdContext, (unsigned char *) "\r\n",2);
- else
- MD5Update (&mdContext, (unsigned char *) cp, 1);
- }
- if (ferror (ce->ce_fp)) {
- content_error (ce->ce_file, ct, "error writing to");
- goto clean_up;
+ if (cp + 1 >= ep || cp + 2 >= ep) {
+ /* We don't have 2 bytes left, so this is an invalid
+ * escape sequence; just show the raw bytes (below). */
+ } else if (isxdigit (cp[1]) && isxdigit (cp[2])) {
+ /* Next 2 bytes are hex digits, making this a valid escape
+ * sequence; let's decode it (above). */
+ quoted = 1;
+ continue;
+ } else {
+ /* One or both of the next 2 is out of range, making this
+ * an invalid escape sequence; just show the raw bytes
+ * (below). */