瀏覽代碼

Fix coredump on parsing invalid traditional option

* src/tar.c (find_argp_option): Fix loop termination condition.
Sergey Poznyakoff 9 年之前
父節點
當前提交
da7845c656
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/tar.c

+ 1 - 1
src/tar.c

@@ -2133,7 +2133,7 @@ find_argp_option (struct argp *ap, int key)
   p = find_argp_option_key (ap->options, key);
   p = find_argp_option_key (ap->options, key);
   if (!p && ap->children)
   if (!p && ap->children)
     {
     {
-      for (child = ap->children; child; child++)
+      for (child = ap->children; child->argp; child++)
 	{
 	{
 	  p = find_argp_option_key (child->argp->options, key);
 	  p = find_argp_option_key (child->argp->options, key);
 	  if (p)
 	  if (p)