From 2f734506ac8a1ad2611da053852c2367a8fe5b63 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 9 Jun 1996 07:34:27 +0000 Subject: Ack! You can't strdup() a DB datum that is not null terminated, or you get seemingly random SEGV's... --- usr.sbin/yppush/yppush_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.sbin/yppush') 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 @@ -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. */ -- cgit v1.1