]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Avoid potential null-dereference
authorDaiki Ueno <ueno@gnu.org>
Tue, 9 Dec 2014 07:05:49 +0000 (16:05 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 9 Dec 2014 07:05:49 +0000 (16:05 +0900)
* xgettext.c (arglist_parser_done): Avoid potential
null-dereference.  Spotted by clang-analyzer.

gettext-tools/src/ChangeLog
gettext-tools/src/xgettext.c

index 926e5abc38cdb68b64558ef519f6969f737edffe..cb8e1101c99cfcd058280ce5cd9cb4dc16309070 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-09  Daiki Ueno  <ueno@gnu.org>
+
+       * xgettext.c (arglist_parser_done): Avoid potential
+       null-dereference.  Spotted by clang-analyzer.
+
 2014-12-09  Daiki Ueno  <ueno@gnu.org>
 
        * msgfmt.c (msgfmt_desktop_bulk): Don't dereference potentially
index 7a4f71a25395677e6f4ef1d56d26ae4dfc48e6a6..28d28a0a8d2fd0c64bd517868c1be4f5a193ee6c 100644 (file)
@@ -3181,7 +3181,7 @@ arglist_parser_done (struct arglist_parser *ap, int argnum)
                   const char *xcomment = best_cp->xcomments.item[i];
                   bool found = false;
 
-                  if (mp->comment_dot != NULL)
+                  if (mp != NULL && mp->comment_dot != NULL)
                     {
                       size_t j;