From: Martin Liska Date: Fri, 20 Apr 2018 12:55:36 +0000 (+0200) Subject: Do not overflow string buffer (PR objc/85476). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fffefbf85f60859c21e6844aa06a0f6ce8cd1cdd;p=gcc.git Do not overflow string buffer (PR objc/85476). 2018-04-20 Martin Liska PR objc/85476 * objc-act.c (finish_class): Do not overflow string buffer. From-SVN: r259521 --- diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index d95f3e433aa..63693714d04 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2018-04-20 Martin Liska + + PR objc/85476 + * objc-act.c (finish_class): Do not overflow string buffer. + 2018-01-03 Jakub Jelinek Update copyright years. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index b87f7cc075e..d08693051ea 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -8003,7 +8003,7 @@ finish_class (tree klass) char *setter_name = (char *) alloca (length); tree ret_type, selector, arg_type, arg_name; - strcpy (setter_name, full_setter_name); + memcpy (setter_name, full_setter_name, length - 1); setter_name[length - 1] = '\0'; ret_type = build_tree_list (NULL_TREE, void_type_node); arg_type = build_tree_list (NULL_TREE, TREE_TYPE (x));