Print this page
10127 coreadm is mis-using strcpy()
*** 19,28 ****
--- 19,29 ----
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2018, Joyent, Inc.
*/
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
*** 545,563 ****
if (n >= 1 && name[0] != '\0' &&
(n == 1 || len == strlen(buf))) {
if (n == 1)
value[0] = '\0';
if (strcmp(name, "COREADM_GLOB_PATTERN") == 0) {
! (void) strcpy(gpattern, value);
continue;
}
if (strcmp(name, "COREADM_GLOB_CONTENT") == 0) {
(void) proc_str2content(value, &glob_content);
continue;
}
if (strcmp(name, "COREADM_INIT_PATTERN") == 0) {
! (void) strcpy(ipattern, value);
continue;
}
if (strcmp(name, "COREADM_INIT_CONTENT") == 0) {
(void) proc_str2content(value, &init_content);
continue;
--- 546,566 ----
if (n >= 1 && name[0] != '\0' &&
(n == 1 || len == strlen(buf))) {
if (n == 1)
value[0] = '\0';
if (strcmp(name, "COREADM_GLOB_PATTERN") == 0) {
! (void) strlcpy(gpattern, value,
! sizeof (gpattern));
continue;
}
if (strcmp(name, "COREADM_GLOB_CONTENT") == 0) {
(void) proc_str2content(value, &glob_content);
continue;
}
if (strcmp(name, "COREADM_INIT_PATTERN") == 0) {
! (void) strlcpy(ipattern, value,
! sizeof (ipattern));
continue;
}
if (strcmp(name, "COREADM_INIT_CONTENT") == 0) {
(void) proc_str2content(value, &init_content);
continue;