pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/pkgsrc-2004Q4]: pkgsrc/devel/nasm Pullup ticket 211 - requested by Ad...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a397609073ee
branches: pkgsrc-2004Q4
changeset: 485804:a397609073ee
user: salo <salo%pkgsrc.org@localhost>
date: Fri Jan 07 01:40:27 2005 +0000
description:
Pullup ticket 211 - requested by Adrian Portelli
security fix for nasm
Module Name: pkgsrc
Committed By: adrianp
Date: Thu Jan 6 13:06:10 UTC 2005
Modified Files:
pkgsrc/devel/nasm: Makefile distinfo
Added Files:
pkgsrc/devel/nasm/patches: patch-ac patch-ad patch-ae patch-af
patch-ag patch-ah patch-ai
Log Message:
Bump to nb1 for recent security issue:
http://sourceforge.net/mailarchive/forum.php?thread_id=6166881&forum_id=4978
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-1287
diffstat:
devel/nasm/Makefile | 3 +-
devel/nasm/distinfo | 9 +-
devel/nasm/patches/patch-ac | 118 ++++++++++++++++++++++++++++
devel/nasm/patches/patch-ad | 185 ++++++++++++++++++++++++++++++++++++++++++++
devel/nasm/patches/patch-ae | 17 ++++
devel/nasm/patches/patch-af | 13 +++
devel/nasm/patches/patch-ag | 22 +++++
devel/nasm/patches/patch-ah | 12 ++
devel/nasm/patches/patch-ai | 16 +++
9 files changed, 393 insertions(+), 2 deletions(-)
diffs (truncated from 442 to 300 lines):
diff -r 4fa1d681e5a1 -r a397609073ee devel/nasm/Makefile
--- a/devel/nasm/Makefile Fri Jan 07 01:29:26 2005 +0000
+++ b/devel/nasm/Makefile Fri Jan 07 01:40:27 2005 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.13 2004/12/03 15:14:54 wiz Exp $
+# $NetBSD: Makefile,v 1.13.2.1 2005/01/07 01:40:27 salo Exp $
#
DISTNAME= nasm-0.98.38
+PKGREVISION= 1
CATEGORIES= devel lang
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=nasm/}
diff -r 4fa1d681e5a1 -r a397609073ee devel/nasm/distinfo
--- a/devel/nasm/distinfo Fri Jan 07 01:29:26 2005 +0000
+++ b/devel/nasm/distinfo Fri Jan 07 01:40:27 2005 +0000
@@ -1,6 +1,13 @@
-$NetBSD: distinfo,v 1.4 2003/10/05 09:45:13 wiz Exp $
+$NetBSD: distinfo,v 1.4.10.1 2005/01/07 01:40:27 salo Exp $
SHA1 (nasm-0.98.38.tar.gz) = cb58baa46900e8ce490fdc7c2cada35c2cc49ce0
Size (nasm-0.98.38.tar.gz) = 641727 bytes
SHA1 (patch-aa) = b0a4c91d7448ba630bfb482ab8f97e98753169cb
SHA1 (patch-ab) = bbe1d7219dd2e5ade8f97a4f3070bc87d3a7d4b5
+SHA1 (patch-ac) = 51e0bfa1c64729a4b2d509f48fd4929e591599e7
+SHA1 (patch-ad) = b24badef999b04e1d2fe6bc982077328f0d5ff0d
+SHA1 (patch-ae) = 709de8188a60e2acc7f30e65a0c403a4189011c0
+SHA1 (patch-af) = a02e34f7d2c8637df708e8229a496e505e4e2650
+SHA1 (patch-ag) = 16d8817e73be90d083684669e8aafcc1dfe66242
+SHA1 (patch-ah) = ec63d62e6fbcc33e34bafc9200a91b6325562925
+SHA1 (patch-ai) = 374b62391207364537bd467ce271088717bb4b31
diff -r 4fa1d681e5a1 -r a397609073ee devel/nasm/patches/patch-ac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/nasm/patches/patch-ac Fri Jan 07 01:40:27 2005 +0000
@@ -0,0 +1,118 @@
+$NetBSD: patch-ac,v 1.1.2.2 2005/01/07 01:40:27 salo Exp $
+
+--- preproc.c.orig 2004-12-16 10:49:55 -0500
++++ preproc.c 2004-12-16 10:51:48 -0500
+@@ -528,7 +528,7 @@
+ fname++;
+ fnlen = strcspn(fname, "\"");
+ line = nasm_malloc(20 + fnlen);
+- sprintf(line, "%%line %d %.*s", lineno, fnlen, fname);
++ snprintf(line, 20+fnlen,"%%line %d %.*s", lineno, fnlen, fname);
+ nasm_free(oldline);
+ }
+ if (tasm_compatible_mode)
+@@ -1043,7 +1043,7 @@
+ char *p, *q = t->text + 2;
+
+ q += strspn(q, "$");
+- sprintf(buffer, "..@%lu.", ctx->number);
++ snprintf(buffer, sizeof(buffer), "..@%lu.", ctx->number);
+ p = nasm_strcat(buffer, q);
+ nasm_free(t->text);
+ t->text = p;
+@@ -1520,23 +1520,30 @@
+ t = t->next;
+ continue;
+ }
+- else if (tt->type == TOK_WHITESPACE)
++ if (tt->type == TOK_WHITESPACE)
+ {
+ tt = tt->next;
+ continue;
+ }
+- else if (tt->type != t->type ||
+- mstrcmp(tt->text, t->text, casesense))
++ if (tt->type != t->type)
+ {
+ j = FALSE; /* found mismatching tokens */
+ break;
+ }
+- else
++ /* Unify surrounding quotes for strings */
++ if (t->type == TOK_STRING)
+ {
+- t = t->next;
+- tt = tt->next;
+- continue;
++ tt->text[0] = t->text[0];
++ tt->text[strlen(tt->text) - 1] = t->text[0];
+ }
++ if (mstrcmp(tt->text, t->text, casesense) != 0)
++ {
++ j = FALSE; /* found mismatching tokens */
++ break;
++ }
++
++ t = t->next;
++ tt = tt->next;
+ }
+ if ((t->type != TOK_OTHER || strcmp(t->text, ",")) || tt)
+ j = FALSE; /* trailing gunk on one end or other */
+@@ -1954,7 +1961,7 @@
+ free_tlist(tt);
+
+ /* Now define the macro for the argument */
+- sprintf(directive, "%%define %s (%s+%d)", arg, StackPointer,
++ snprintf(directive, sizeof(directive), "%%define %s (%s+%d)", arg, StackPointer,
+ offset);
+ do_directive(tokenise(directive));
+ offset += size;
+@@ -2051,13 +2058,13 @@
+ free_tlist(tt);
+
+ /* Now define the macro for the argument */
+- sprintf(directive, "%%define %s (%s-%d)", local, StackPointer,
++ snprintf(directive, sizeof(directive), "%%define %s (%s-%d)", local, StackPointer,
+ offset);
+ do_directive(tokenise(directive));
+ offset += size;
+
+ /* Now define the assign to setup the enter_c macro correctly */
+- sprintf(directive, "%%assign %%$localsize %%$localsize+%d",
++ snprintf(directive, sizeof(directive), "%%assign %%$localsize %%$localsize+%d",
+ size);
+ do_directive(tokenise(directive));
+
+@@ -3182,12 +3189,12 @@
+ */
+ case '0':
+ type = TOK_NUMBER;
+- sprintf(tmpbuf, "%d", mac->nparam);
++ snprintf(tmpbuf, sizeof(tmpbuf), "%d", mac->nparam);
+ text = nasm_strdup(tmpbuf);
+ break;
+ case '%':
+ type = TOK_ID;
+- sprintf(tmpbuf, "..@%lu.", mac->unique);
++ snprintf(tmpbuf, sizeof(tmpbuf), "..@%lu.", mac->unique);
+ text = nasm_strcat(tmpbuf, t->text + 2);
+ break;
+ case '-':
+@@ -4067,7 +4074,7 @@
+ return;
+
+ va_start(arg, fmt);
+- vsprintf(buff, fmt, arg);
++ vsnprintf(buff, sizeof(buff), fmt, arg);
+ va_end(arg);
+
+ if (istk && istk->mstk && istk->mstk->name)
+@@ -4530,7 +4537,7 @@
+ make_tok_num(Token * tok, long val)
+ {
+ char numbuf[20];
+- sprintf(numbuf, "%ld", val);
++ snprintf(numbuf, sizeof(numbuf), "%ld", val);
+ tok->text = nasm_strdup(numbuf);
+ tok->type = TOK_NUMBER;
+ }
diff -r 4fa1d681e5a1 -r a397609073ee devel/nasm/patches/patch-ad
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/nasm/patches/patch-ad Fri Jan 07 01:40:27 2005 +0000
@@ -0,0 +1,185 @@
+$NetBSD: patch-ad,v 1.1.2.2 2005/01/07 01:40:27 salo Exp $
+
+--- disasm.c.orig 2003-02-24 18:22:45.000000000 -0500
++++ disasm.c 2004-12-15 18:00:13.000000000 -0500
+@@ -484,8 +484,8 @@
+ return data - origdata;
+ }
+
+-long disasm (unsigned char *data, char *output, int segsize, long offset,
+- int autosync, unsigned long prefer)
++long disasm (unsigned char *data, char *output, int outbufsize, int segsize,
++ long offset, int autosync, unsigned long prefer)
+ {
+ struct itemplate **p, **best_p;
+ int length, best_length = 0;
+@@ -583,26 +583,26 @@
+ slen = 0;
+
+ if (lock)
+- slen += sprintf(output+slen, "lock ");
++ slen += snprintf(output+slen, outbufsize-slen, "lock ");
+ for (i = 0; i < ins.nprefix; i++)
+ switch (ins.prefixes[i]) {
+- case P_REP: slen += sprintf(output+slen, "rep "); break;
+- case P_REPE: slen += sprintf(output+slen, "repe "); break;
+- case P_REPNE: slen += sprintf(output+slen, "repne "); break;
+- case P_A16: slen += sprintf(output+slen, "a16 "); break;
+- case P_A32: slen += sprintf(output+slen, "a32 "); break;
+- case P_O16: slen += sprintf(output+slen, "o16 "); break;
+- case P_O32: slen += sprintf(output+slen, "o32 "); break;
++ case P_REP: slen += snprintf(output+slen, outbufsize-slen, "rep "); break;
++ case P_REPE: slen += snprintf(output+slen, outbufsize-slen, "repe "); break;
++ case P_REPNE: slen += snprintf(output+slen, outbufsize-slen, "repne "); break;
++ case P_A16: slen += snprintf(output+slen, outbufsize-slen, "a16 "); break;
++ case P_A32: slen += snprintf(output+slen, outbufsize-slen, "a32 "); break;
++ case P_O16: slen += snprintf(output+slen, outbufsize-slen, "o16 "); break;
++ case P_O32: slen += snprintf(output+slen, outbufsize-slen, "o32 "); break;
+ }
+
+ for (i = 0; i < elements(ico); i++)
+ if ((*p)->opcode == ico[i]) {
+- slen += sprintf(output+slen, "%s%s", icn[i],
++ slen += snprintf(output+slen, outbufsize-slen, "%s%s", icn[i],
+ whichcond(ins.condition));
+ break;
+ }
+ if (i >= elements(ico))
+- slen += sprintf(output+slen, "%s", insn_names[(*p)->opcode]);
++ slen += snprintf(output+slen, outbufsize-slen, "%s", insn_names[(*p)->opcode]);
+ colon = FALSE;
+ length += data - origdata; /* fix up for prefixes */
+ for (i=0; i<(*p)->operands; i++) {
+@@ -633,14 +633,14 @@
+ ins.oprs[i].basereg = whichreg ((*p)->opd[i],
+ ins.oprs[i].basereg);
+ if ( (*p)->opd[i] & TO )
+- slen += sprintf(output+slen, "to ");
+- slen += sprintf(output+slen, "%s",
++ slen += snprintf(output+slen, outbufsize-slen, "to ");
++ slen += snprintf(output+slen, outbufsize-slen, "%s",
+ reg_names[ins.oprs[i].basereg-EXPR_REG_START]);
+ } else if (!(UNITY & ~(*p)->opd[i])) {
+ output[slen++] = '1';
+ } else if ( (*p)->opd[i] & IMMEDIATE ) {
+ if ( (*p)->opd[i] & BITS8 ) {
+- slen += sprintf(output+slen, "byte ");
++ slen += snprintf(output+slen, outbufsize-slen, "byte ");
+ if (ins.oprs[i].segment & SEG_SIGNED) {
+ if (ins.oprs[i].offset < 0) {
+ ins.oprs[i].offset *= -1;
+@@ -649,17 +649,17 @@
+ output[slen++] = '+';
+ }
+ } else if ( (*p)->opd[i] & BITS16 ) {
+- slen += sprintf(output+slen, "word ");
++ slen += snprintf(output+slen, outbufsize-slen, "word ");
+ } else if ( (*p)->opd[i] & BITS32 ) {
+- slen += sprintf(output+slen, "dword ");
++ slen += snprintf(output+slen, outbufsize-slen, "dword ");
+ } else if ( (*p)->opd[i] & NEAR ) {
+- slen += sprintf(output+slen, "near ");
++ slen += snprintf(output+slen, outbufsize-slen, "near ");
+ } else if ( (*p)->opd[i] & SHORT ) {
+- slen += sprintf(output+slen, "short ");
++ slen += snprintf(output+slen, outbufsize-slen, "short ");
+ }
+- slen += sprintf(output+slen, "0x%lx", ins.oprs[i].offset);
++ slen += snprintf(output+slen, outbufsize-slen, "0x%lx", ins.oprs[i].offset);
+ } else if ( !(MEM_OFFS & ~(*p)->opd[i]) ) {
+- slen += sprintf(output+slen, "[%s%s%s0x%lx]",
++ slen += snprintf(output+slen, outbufsize-slen, "[%s%s%s0x%lx]",
+ (segover ? segover : ""),
+ (segover ? ":" : ""),
+ (ins.oprs[i].addr_size == 32 ? "dword " :
+@@ -669,30 +669,30 @@
+ } else if ( !(REGMEM & ~(*p)->opd[i]) ) {
+ int started = FALSE;
+ if ( (*p)->opd[i] & BITS8 )
+- slen += sprintf(output+slen, "byte ");
++ slen += snprintf(output+slen, outbufsize-slen, "byte ");
+ if ( (*p)->opd[i] & BITS16 )
+- slen += sprintf(output+slen, "word ");
++ slen += snprintf(output+slen, outbufsize-slen, "word ");
+ if ( (*p)->opd[i] & BITS32 )
+- slen += sprintf(output+slen, "dword ");
++ slen += snprintf(output+slen, outbufsize-slen, "dword ");
+ if ( (*p)->opd[i] & BITS64 )
+- slen += sprintf(output+slen, "qword ");
++ slen += snprintf(output+slen, outbufsize-slen, "qword ");
+ if ( (*p)->opd[i] & BITS80 )
+- slen += sprintf(output+slen, "tword ");
++ slen += snprintf(output+slen, outbufsize-slen, "tword ");
+ if ( (*p)->opd[i] & FAR )
+- slen += sprintf(output+slen, "far ");
++ slen += snprintf(output+slen, outbufsize-slen, "far ");
+ if ( (*p)->opd[i] & NEAR )
+- slen += sprintf(output+slen, "near ");
++ slen += snprintf(output+slen, outbufsize-slen, "near ");
+ output[slen++] = '[';
+ if (ins.oprs[i].addr_size)
+- slen += sprintf(output+slen, "%s",
++ slen += snprintf(output+slen, outbufsize-slen, "%s",
+ (ins.oprs[i].addr_size == 32 ? "dword " :
+ ins.oprs[i].addr_size == 16 ? "word " : ""));
+ if (segover) {
+- slen += sprintf(output+slen, "%s:", segover);
++ slen += snprintf(output+slen, outbufsize-slen, "%s:", segover);
+ segover = NULL;
+ }
+ if (ins.oprs[i].basereg != -1) {
+- slen += sprintf(output+slen, "%s",
++ slen += snprintf(output+slen, outbufsize-slen, "%s",
+ reg_names[(ins.oprs[i].basereg -
+ EXPR_REG_START)]);
+ started = TRUE;
+@@ -700,11 +700,11 @@
+ if (ins.oprs[i].indexreg != -1) {
+ if (started)
+ output[slen++] = '+';
+- slen += sprintf(output+slen, "%s",
++ slen += snprintf(output+slen, outbufsize-slen, "%s",
+ reg_names[(ins.oprs[i].indexreg -
+ EXPR_REG_START)]);
Home |
Main Index |
Thread Index |
Old Index