Project

General

Profile

Actions

Bug #1067

closed

asf patch

Added by eric.j.christeson over 16 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

asf(8) dumps core if you give it '\n' as input. More specifically, if
it has less than 2 tokens.
Patch attached.
Thanks to Antonio Huete Jimenez for getting me interested in this.

Index: usr.sbin/asf/asf.c ===================================================================
RCS file: /home/dcvs2/src/usr.sbin/asf/asf.c,v
retrieving revision 1.5
diff u -r1.5 asf.c
--
usr.sbin/asf/asf.c 19 May 2008 10:13:08 -0000 1.5
+++ usr.sbin/asf/asf.c 10 Jul 2008 21:26:11 -0000
@ -254,6 +254,8 @
quad_t bssaddr;

tokens = tokenize(buf, token, MAXTOKEN);
+ if (tokens <= 1)
+ continue;
base = strtoll(token[2], NULL, 16);
if (!dofind) {
snprintf(ocbuf,
Actions #1

Updated by nthery over 16 years ago

The patch looks fine.

Actions #2

Updated by dillon over 16 years ago

:..
:> quad_t bssaddr;
:>
:> tokens = tokenize(buf, token, MAXTOKEN);
:> + if (tokens <= 1)
:> + continue;
:> base = strtoll(token2, NULL, 16);
:> if (!dofind) {
:> snprintf(ocbuf,
:>

I've committed it.
-Matt
Matthew Dillon
&lt;&gt;
Actions #3

Updated by matthias over 16 years ago

Committed by dillon@

Actions

Also available in: Atom PDF