$OpenBSD: patch-gpasm_util_c,v 1.1.1.1 2003/11/03 01:02:36 naddy Exp $ --- gpasm/util.c.orig 2003-05-11 03:55:55.000000000 +1000 +++ gpasm/util.c 2003-10-14 23:16:18.000000000 +1000 @@ -39,7 +39,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" , @@ -120,7 +120,7 @@ convert_escape_chars(char *ps, int *valu ps[2] = '\0'; ps += 2; } else { - strncpy(buffer, &ps[2], 2); + strlcpy(buffer, &ps[2], sizeof(buffer)); *value = stringtolong(buffer, 16); ps += 4; } @@ -186,7 +186,7 @@ void set_global(char *name, if (var->value != value) { char message[BUFSIZ]; - sprintf(message, + snprintf(message, sizeof(message), "Value of symbol \"%s\" differs on second pass\n pass 1=%d, pass 2=%d", name,var->value,value); gperror(GPE_DIFFLAB, message);