File gpart-0.1h-array_overflow.diff of Package gpart

---
 src/gpart.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: src/gpart.c
===================================================================
--- src/gpart.c.orig
+++ src/gpart.c
@@ -602,11 +602,11 @@ static void print_ext_partitions(disk_de
 	for ( ; pt; pt = pt->t_ext)
 	{
 		pr(MSG,PM_EXTPART);
-		for (p = pt->t_parts; p < &pt->t_parts[NDOSPARTS + 1]; p++)
+		for (p = pt->t_parts; p <= &pt->t_parts[NDOSPARTS - 1]; p++)
 			if (is_real_parttype(p))
 				print_partition(d,p,1,offset + extst);
 
-		for (p = pt->t_parts; p < &pt->t_parts[NDOSPARTS + 1]; p++)
+		for (p = pt->t_parts; p <= &pt->t_parts[NDOSPARTS - 1]; p++)
 			if (is_ext_parttype(p))
 				extst = p->p_start;
 	}