[PATCH 2/4] libdvbv5: Fix reallocation in parse_lcn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Detected by Coverity.

Signed-off-by: Gregor Jasny <gjasny@xxxxxxxxxxxxxx>
CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux