diff options
author | peter <peter@FreeBSD.org> | 1996-06-09 07:34:27 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-06-09 07:34:27 +0000 |
commit | 2f734506ac8a1ad2611da053852c2367a8fe5b63 (patch) | |
tree | 0974321b68dedd4a9c581dd10f7e2a71c4587804 /usr.sbin | |
parent | 896e5dbb710f121cf03937b61352cc6bbbeb3d1c (diff) | |
download | FreeBSD-src-2f734506ac8a1ad2611da053852c2367a8fe5b63.zip FreeBSD-src-2f734506ac8a1ad2611da053852c2367a8fe5b63.tar.gz |
Ack! You can't strdup() a DB datum that is not null terminated, or you
get seemingly random SEGV's...
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/yppush/yppush_main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/yppush/yppush_main.c b/usr.sbin/yppush/yppush_main.c index 12137ee..fb9e078 100644 --- a/usr.sbin/yppush/yppush_main.c +++ b/usr.sbin/yppush/yppush_main.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: yppush_main.c,v 1.3 1996/04/03 03:24:03 wpaul Exp $ + * $Id: yppush_main.c,v 1.4 1996/04/29 05:24:26 wpaul Exp $ */ #include <stdio.h> @@ -53,7 +53,7 @@ struct dom_binding {}; #include "yppush_extern.h" #ifndef lint -static const char rcsid[] = "$Id: yppush_main.c,v 1.3 1996/04/03 03:24:03 wpaul Exp $"; +static const char rcsid[] = "$Id: yppush_main.c,v 1.4 1996/04/29 05:24:26 wpaul Exp $"; #endif char *progname = "yppush"; @@ -628,7 +628,8 @@ main(argc,argv) #endif } - yppush_master = strdup(data.data); + yppush_master = malloc(data.size + 1); + strncpy(yppush_master, data.data, data.size); yppush_master[data.size] = '\0'; /* Install some handy handlers. */ |