Article View: net.bugs.v7
Article #103sed y bug
From: utzoohenry
Date: Thu, 09 Dec 1982 19:07
Date: Thu, 09 Dec 1982 19:07
13 lines
808 bytes
808 bytes
The y command of sed(1) has a minor bug: it does not check properly for a missing trailing delimiter. It will catch the missing delimiter if the command is ended by a newline (i.e. commands are from a file) but not if the command is ended by a NUL. So, for example, the command "sed your old man" dumps core. The fix is to change the following line in sed0.c (about line 943): if(*tsp == '\n') to if(*tsp == '\n' || *tsp == '\0') Ron Gomes of HCR described this one to me long ago; Laura Creighton figured out the exact fix here.
Technical Details
Message-ID:
<bnews.utzoo.2680>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!henry Newsgroups: net.bugs.v7 Title: sed y bug Article-I.D.: utzoo.2680 Posted: Thu Dec 9 19:07:23 1982 Received: Thu Dec 9 19:07:23 1982 Subject: sed y bug Date: Thu, 09 Dec 1982 19:07:23 +0000 Message-ID: <bnews.utzoo.2680>