Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst Avoid undefined behaviour, pointed out by maxv



details:   https://anonhg.NetBSD.org/src/rev/e3945aa1d139
branches:  trunk
changeset: 446659:e3945aa1d139
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Dec 13 12:28:25 2018 +0000

description:
Avoid undefined behaviour, pointed out by maxv

diffstat:

 usr.sbin/sysinst/partman.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 74b8a19a9751 -r e3945aa1d139 usr.sbin/sysinst/partman.c
--- a/usr.sbin/sysinst/partman.c        Thu Dec 13 12:13:33 2018 +0000
+++ b/usr.sbin/sysinst/partman.c        Thu Dec 13 12:28:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partman.c,v 1.24 2018/11/27 17:13:41 martin Exp $ */
+/*     $NetBSD: partman.c,v 1.25 2018/12/13 12:28:25 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -913,7 +913,7 @@
                        for (ii = 0; ii < 6; ii++) {
                                strcpy(buf, pm_i->bsdlabel[ii].pi_mount);
                                if (buf[strlen(buf)-1] != '/')
-                                       sprintf(buf,"%s/", buf);
+                                       strcat(buf, "/");
                                printf("%s\n",buf);
                                if (strstr(vnds[i].filepath, buf) == vnds[i].filepath)
                                        if (part_suit < 0 || pm_suit == NULL ||



Home | Main Index | Thread Index | Old Index