diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2006-01-17 00:56:05 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2006-01-17 00:56:05 +0000 |
commit | 3322550097893d5d72985106e8468ed1d4968fca (patch) | |
tree | 2e265f4c59bf93b8d0f47bf9a4a63b855be67264 /usr.bin | |
parent | 1572d57368cb7a963707912bdb02a2d0a59ec7e5 (diff) |
Fix malloc calculation to avoid memory bounds error. deraadt@ ok
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cdio/cddb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cdio/cddb.c b/usr.bin/cdio/cddb.c index 9ea17188f55..847516a2cf7 100644 --- a/usr.bin/cdio/cddb.c +++ b/usr.bin/cdio/cddb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cddb.c,v 1.9 2005/11/12 15:26:23 deraadt Exp $ */ +/* $OpenBSD: cddb.c,v 1.10 2006/01/17 00:56:04 aaron Exp $ */ /* * Copyright (c) 2002 Marc Espie. * @@ -326,7 +326,7 @@ cddb(const char *host_port, int n, struct cd_toc_entry *e, char *arg) } } else if (strcmp(line, "200") != 0 || !further_query(cout, type)) goto end; - result = malloc(sizeof(char *) * n+1); + result = malloc(sizeof(char *) * (n + 1)); if (!result) goto end; for (i = 0; i <= n; i++) |