missing regex fix from FreeBSD?

classic Classic list List threaded Threaded
4 messages Options
enh
Reply | Threaded
Open this post in threaded view
|

missing regex fix from FreeBSD?

enh
it seems like OpenBSD did cherrypick this FreeBSD regex fix...

https://github.com/freebsd/freebsd/commit/981dd2aa38f37e4d0dd86225c619e900fc03d82e#diff-d7c26714f9432399b202eefcedb97491

...but not this one, which also seems to apply to the OpenBSD copy of the code?

https://github.com/freebsd/freebsd/commit/95b1feb22b6da0549367ed0023308f0abfa8086b#diff-d7c26714f9432399b202eefcedb97491

(NetBSD seems to have cherrypicked neither. i'll mail them about that.)

Reply | Threaded
Open this post in threaded view
|

Re: missing regex fix from FreeBSD?

Ted Unangst-6
enh wrote:
> it seems like OpenBSD did cherrypick this FreeBSD regex fix...
>
> https://github.com/freebsd/freebsd/commit/981dd2aa38f37e4d0dd86225c619e900fc03d82e#diff-d7c26714f9432399b202eefcedb97491

That's an odd way to phrase applying a diff that was sent to OpenBSD...

> ...but not this one, which also seems to apply to the OpenBSD copy of the code?
>
> https://github.com/freebsd/freebsd/commit/95b1feb22b6da0549367ed0023308f0abfa8086b#diff-d7c26714f9432399b202eefcedb97491

But this does look like a fix we could use.

Reply | Threaded
Open this post in threaded view
|

Re: missing regex fix from FreeBSD?

Todd C. Miller-3
In reply to this post by enh
On Mon, 04 Feb 2019 14:06:22 -0800, enh wrote:

> it seems like OpenBSD did cherrypick this FreeBSD regex fix...
>
> https://github.com/freebsd/freebsd/commit/981dd2aa38f37e4d0dd86225c619e900fc0
> 3d82e#diff-d7c26714f9432399b202eefcedb97491
>
> ...but not this one, which also seems to apply to the OpenBSD copy of the cod
> e?
>
> https://github.com/freebsd/freebsd/commit/95b1feb22b6da0549367ed0023308f0abfa
> 8086b#diff-d7c26714f9432399b202eefcedb97491

Here's a diff relative to our regcomp.c.

 - todd

Index: lib/libc/regex/regcomp.c
===================================================================
RCS file: /cvs/src/lib/libc/regex/regcomp.c,v
retrieving revision 1.32
diff -u -p -u -r1.32 regcomp.c
--- lib/libc/regex/regcomp.c 30 Oct 2017 06:48:20 -0000 1.32
+++ lib/libc/regex/regcomp.c 5 Feb 2019 16:42:55 -0000
@@ -353,6 +353,8 @@ p_ere_exp(struct parse *p)
  REQUIRE(!MORE() || !isdigit((uch)PEEK()), REG_BADRPT);
  /* FALLTHROUGH */
  default:
+ if (p->error != 0)
+ return;
  ordinary(p, c);
  break;
  }
@@ -555,6 +557,8 @@ p_simp_re(struct parse *p,
  REQUIRE(starordinary, REG_BADRPT);
  /* FALLTHROUGH */
  default:
+ if (p->error != 0)
+ return;
  ordinary(p, (char)c);
  break;
  }

enh
Reply | Threaded
Open this post in threaded view
|

Re: missing regex fix from FreeBSD?

enh
In reply to this post by Ted Unangst-6
On Mon, Feb 4, 2019 at 7:00 PM Ted Unangst <[hidden email]> wrote:
>
> enh wrote:
> > it seems like OpenBSD did cherrypick this FreeBSD regex fix...
> >
> > https://github.com/freebsd/freebsd/commit/981dd2aa38f37e4d0dd86225c619e900fc03d82e#diff-d7c26714f9432399b202eefcedb97491
>
> That's an odd way to phrase applying a diff that was sent to OpenBSD...

sorry, i didn't check provenance. i just assumed that the change with
the more detailed commit message (FreeBSD's) was the "original".

> > ...but not this one, which also seems to apply to the OpenBSD copy of the code?
> >
> > https://github.com/freebsd/freebsd/commit/95b1feb22b6da0549367ed0023308f0abfa8086b#diff-d7c26714f9432399b202eefcedb97491
>
> But this does look like a fix we could use.