diff --git a/sys/dev/dkwedge/dkwedge_gpt.c b/sys/dev/dkwedge/dkwedge_gpt.c index b650d03343e4..f4e3351649e5 100644 --- a/sys/dev/dkwedge/dkwedge_gpt.c +++ b/sys/dev/dkwedge/dkwedge_gpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dkwedge_gpt.c,v 1.18 2017/01/19 00:44:40 maya Exp $ */ +/* $NetBSD: dkwedge_gpt.c,v 1.19 2017/09/06 18:21:17 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.18 2017/01/19 00:44:40 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.19 2017/09/06 18:21:17 christos Exp $"); #include #include @@ -252,7 +252,8 @@ dkwedge_discover_gpt(struct disk *pdk, struct vnode *vp) else { c = dkw.dkw_wname; r = sizeof(dkw.dkw_wname) - 1; - for (j = 0; ent->ent_name[j] != 0x0000; j++) { + for (j = 0; j < sizeof(ent->ent_name) + && ent->ent_name[j] != 0x0000; j++) { n = wput_utf8(c, r, le16toh(ent->ent_name[j])); if (n == 0) break;