+2015-01-24 Daiki Ueno <ueno@gnu.org>
+
+ xgettext, msgmerge: Avoid undefined non-null argument behavior
+ * xgettext.c (remember_a_message): Building with gcc's
+ -fsanitize=undefined and running tests triggered:
+ xgettext.c:2425:17: runtime error: null pointer passed as argument \
+ 2, which is declared to never be null
+ Adjust the argument of strncmp to never be null.
+ * msgmerge.c (message_merge): Likewise for memcpy.
+
2015-01-23 Daiki Ueno <ueno@gnu.org>
build: Fix parallel build from git checkout
char *extended =
(char *) obstack_alloc (&pool,
header_fields[UNKNOWN].len + len + 1);
- memcpy (extended, header_fields[UNKNOWN].string,
- header_fields[UNKNOWN].len);
+ if (header_fields[UNKNOWN].string)
+ memcpy (extended, header_fields[UNKNOWN].string,
+ header_fields[UNKNOWN].len);
memcpy (&extended[header_fields[UNKNOWN].len], cp, len);
extended[header_fields[UNKNOWN].len + len] = '\0';
header_fields[UNKNOWN].string = extended;
/* The string before the comment tag. For example, If "** TRANSLATORS:"
is seen and the comment tag is "TRANSLATORS:",
then comment_tag_prefix is set to "** ". */
- const char *comment_tag_prefix = NULL;
+ const char *comment_tag_prefix = "";
size_t comment_tag_prefix_length = 0;
nitems_before = (mp->comment_dot != NULL ? mp->comment_dot->nitems : 0);