[2/4] libdvbv5: Fix reallocation in parse_lcn

Message ID 1374757774-29051-3-git-send-email-gjasny@googlemail.com (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Gregor Jasny July 25, 2013, 1:09 p.m. UTC
  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(-)
  

Patch

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++;