Date: Sat, 14 Oct 2000 21:07:13 +0800 (CST) From: keith@freebsd.sinica.edu.tw To: FreeBSD-gnats-submit@freebsd.org Subject: ports/21984: Fix chinese/libtabe on current (MAINTAINER) Message-ID: <200010141307.VAA36407@freebsd.sinica.edu.tw>
next in thread | raw e-mail | index | archive | help
>Number: 21984 >Category: ports >Synopsis: chinese/libtabe dumps on current machine >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Oct 14 06:10:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Jing-Tang Keith Jang >Release: FreeBSD 4.0-20000406-STABLE i386 >Organization: >Environment: 5-current, and 4.x-stable where /etc/malloc.conf is linked to AJ. >Description: Several bugs revealed after phk turned on malloc()'s extra sanity feature, which causes chinese/libtabe coredump during build. >How-To-Repeat: It just can't compile on current, or stable with /etc/malloc.conf->AJ. >Fix: Please commit the following patch as libtabe/files/patch-ac, thanks. --- src/tabe_tsidbint.c.orig Fri Oct 6 20:43:20 2000 +++ src/tabe_tsidbint.c Fri Oct 13 00:00:46 2000 @@ -420,8 +420,8 @@ } /* we depends on the caller to allocate enough large buffer */ - strcpy((char *)tsi->tsi, key.data); - tsi->tsi[key.size] = (unsigned char)NULL; + *((char *)tsi->tsi) = '\0'; + strncat((char *)tsi->tsi, (char *)key.data, key.size); TsiDBUnpackDataDB(tsi, &dat); return(0); @@ -454,8 +454,8 @@ } /* we depends on the caller to allocate buffer large enough */ - strcpy((char *)tsi->tsi, key.data); - tsi->tsi[key.size] = (unsigned char)NULL; + *((char *)tsi->tsi) = '\0'; + strncat((char *)tsi->tsi, (char *)key.data, key.size); TsiDBUnpackDataDB(tsi, &dat); @@ -489,8 +489,8 @@ } /* we depends on the caller to allocate enough large buffer */ - strcpy((char *)tsi->tsi, key.data); - tsi->tsi[key.size] = (unsigned char)NULL; + *((char *)tsi->tsi) = '\0'; + strncat((char *)tsi->tsi, (char *)key.data, key.size); TsiDBUnpackDataDB(tsi, &dat); --- src/util/tsidel.c.orig Thu Oct 5 22:58:28 2000 +++ src/util/tsidel.c Thu Oct 12 23:04:25 2000 @@ -47,6 +47,7 @@ memset(tsi->tsi, 0, 80); tsi->refcount = -1; tsi->yinnum = -1; + tsi->yindata = (Yin *)NULL; i = j = 0; while (1) { --- src/util/tsidump.c.orig Thu Oct 5 22:58:46 2000 +++ src/util/tsidump.c Mon Oct 9 14:53:22 2000 @@ -22,7 +22,7 @@ { printf("Usage: tsidump -d <TsiDB> [-f output file -ry]\n"); printf(" -d <TsiDB> \t path to TsiDB\n"); - printf(" -f <input file>\t input file in plain text (default: stdin)\n"); + printf(" -f <output file>\t output file in plain text (default: stdout)\n"); printf(" -r \t include reference count (default: not)\n"); printf(" -y \t include yin data (default: not)\n"); exit(0); @@ -45,6 +45,7 @@ memset(tsi->tsi, 0, 80); tsi->refcount = -1; tsi->yinnum = -1; + tsi->yindata = (Yin *)NULL; i = 0; while (1) { --- src/util/tsiyindump.c.orig Thu Oct 5 22:59:05 2000 +++ src/util/tsiyindump.c Thu Oct 12 23:06:24 2000 @@ -44,6 +44,7 @@ memset(tsi->tsi, 0, 80); tsi->refcount = -1; tsi->yinnum = -1; + tsi->yindata = (Yin *)NULL; tsiyin = (struct TsiYinInfo *)malloc(sizeof(struct TsiYinInfo)); memset(tsiyin, 0, sizeof(struct TsiYinInfo)); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010141307.VAA36407>