All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregor Jasny <gjasny@googlemail.com>
To: linux-media@vger.kernel.org
Cc: Gregor Jasny <gjasny@googlemail.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 2/4] libdvbv5: Fix reallocation in parse_lcn
Date: Thu, 25 Jul 2013 15:09:32 +0200	[thread overview]
Message-ID: <1374757774-29051-3-git-send-email-gjasny@googlemail.com> (raw)
In-Reply-To: <1374757774-29051-1-git-send-email-gjasny@googlemail.com>

Detected by Coverity.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
CC: Mauro Carvalho Chehab <mchehab@infradead.org>
---
 lib/libdvbv5/descriptors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libdvbv5/descriptors.c b/lib/libdvbv5/descriptors.c
index 73338d8..99d8fa3 100644
--- a/lib/libdvbv5/descriptors.c
+++ b/lib/libdvbv5/descriptors.c
@@ -758,7 +758,7 @@ static void parse_lcn(struct nit_table *nit_table,
 	for (i = 0; i < dlen; i+= 4, p+= 4) {
 		struct lcn_table **lcn = &nit_table->lcn;
 
-		*lcn = realloc(*lcn, (n + 1) * sizeof(*lcn));
+		*lcn = realloc(*lcn, (n + 1) * sizeof(**lcn));
 		(*lcn)[n].service_id = p[0] << 8 | p[1];
 		(*lcn)[n].lcn = (p[2] << 8 | p[3]) & 0x3ff;
 		nit_table->lcn_len++;
-- 
1.8.3.2


  parent reply	other threads:[~2013-07-25 13:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 13:09 [PATCH 0/4] v4l-utils: Some fixes for Coverity issues Gregor Jasny
2013-07-25 13:09 ` [PATCH 1/4] xc3082: Fix use after free in free_firmware() Gregor Jasny
2013-07-25 13:09 ` Gregor Jasny [this message]
2013-07-25 13:09 ` [PATCH 3/4] rds-ctl: Always terminate strings properly Gregor Jasny
2013-07-25 13:27   ` Hans Verkuil
2013-07-25 13:09 ` [PATCH 4/4] libdvbv5: Fix copy and paste error in parse_service() Gregor Jasny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374757774-29051-3-git-send-email-gjasny@googlemail.com \
    --to=gjasny@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.