bin/128094: Sizeof(pointer) bug in usr.bin/xlint/lint1/scan.l .
Henning Petersen
henning.petersen at t-online.de
Tue Oct 14 16:00:07 UTC 2008
>Number: 128094
>Category: bin
>Synopsis: Sizeof(pointer) bug in usr.bin/xlint/lint1/scan.l .
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Oct 14 16:00:05 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Henning Petersen
>Release: current-Freebsd
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
--- src/usr.bin/xlint/lint1/scan.l 1 Jan 2003 18:13:44 -0000 1.12
+++ src/usr.bin/xlint/lint1/scan.l 14 Oct 2008 06:13:09 -0000
@@ -319,7 +319,7 @@
if ((sb = malloc(sizeof (sbuf_t))) == NULL)
nomem();
}
- (void)memset(sb, 0, sizeof (sb));
+ (void)memset(sb, 0, sizeof (*sb));
return (sb);
}
Patch attached with submission follows:
Index: src/usr.bin/xlint/lint1/scan.l
===================================================================
RCS file: /usr/ncvs/src/usr.bin/xlint/lint1/scan.l,v
retrieving revision 1.12
diff -u -r1.12 scan.l
--- src/usr.bin/xlint/lint1/scan.l 1 Jan 2003 18:13:44 -0000 1.12
+++ src/usr.bin/xlint/lint1/scan.l 14 Oct 2008 06:13:09 -0000
@@ -319,7 +319,7 @@
if ((sb = malloc(sizeof (sbuf_t))) == NULL)
nomem();
}
- (void)memset(sb, 0, sizeof (sb));
+ (void)memset(sb, 0, sizeof (*sb));
return (sb);
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list