$OpenBSD: patch-gpal_scan_c,v 1.1 2004/01/30 01:01:11 naddy Exp $ --- gpal/scan.c.orig 2004-01-26 10:40:47.000000000 +1100 +++ gpal/scan.c 2004-01-26 10:44:21.000000000 +1100 @@ -1919,9 +1919,9 @@ search_pathes(struct source_context *new gp_linked_list *path = state.path; while (path) { - strcpy(tryname, gp_list_get(path)); - strcat(tryname, COPY_CHAR); - strcat(tryname, name); + strlcpy(tryname, gp_list_get(path), sizeof(tryname)); + strlcat(tryname, COPY_CHAR, sizeof(tryname)); + strlcat(tryname, name, sizeof(tryname)); new->f = fopen(tryname, "rt"); if(new->f) { new->name = strdup(tryname); @@ -1945,8 +1945,8 @@ void open_src(char *name, enum source_ty length = strlen(name); length += strlen(".pub") + 1; file_name = malloc(length); - strcpy(file_name, name); - strcat(file_name, ".pub"); + strlcpy(file_name, name, length); + strlcat(file_name, ".pub", length); } else { file_name = strdup(name); } @@ -2035,7 +2035,7 @@ stringtolong(char *string, int radix) if ((endptr == NULL) || (*endptr != '\0')) { char complaint[80]; - sprintf(complaint, + snprintf(complaint, sizeof(complaint), isprint(*endptr) ? "Illegal character '%c' in numeric constant " : "Illegal character %#x in numeric constant" ,