Skip to content

formail core dumps on iscntrl(*p) #13

Description

@leahneukirchen

Forwarding this from the NetBSD PR 59513: https://gnats.netbsd.org/59513

formail (which is built as part of pkgsrc/mail/procmail)
includes a single use of iscntrl() which it uses as
iscntrl(*p)
where p is a char *. Once upon a time that simply
returned a random result when *p < 0, now it SEGV's (in HEAD anyway).

Suggested patch:

--- formail.c.orig	2025-07-07 09:27:24.898676824 +0700
+++ formail.c	2025-07-07 09:14:55.802502352 +0700
@@ -897,7 +897,7 @@
   while(len)
    { switch(*p)
       { default:len--;
-	   if(iscntrl(*p))		    /* no control characters allowed */
+	   if(iscntrl(*(unsigned char *)p))		    /* no control characters allowed */
 	      break;
 	   p++;
 	   continue;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions