summaryrefslogtreecommitdiff
path: root/mk/wrapper/logic
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-09-22 08:35:01 +0000
committerjlam <jlam@pkgsrc.org>2004-09-22 08:35:01 +0000
commit91118f06d0606b800a35ca5530ca3ebf4fbfddc1 (patch)
tree236abd649de78677c022a4b421ec6cd90c2cfbeb /mk/wrapper/logic
parentb4138c5d83e765689bf160301d4bf60b44c4db47 (diff)
downloadpkgsrc-91118f06d0606b800a35ca5530ca3ebf4fbfddc1.tar.gz
Protect against underflow in the argument buffer in the inner while loop,
noted in PR pkg/27014.
Diffstat (limited to 'mk/wrapper/logic')
-rw-r--r--mk/wrapper/logic18
1 files changed, 5 insertions, 13 deletions
diff --git a/mk/wrapper/logic b/mk/wrapper/logic
index 11818488e3c..3d94ef5d233 100644
--- a/mk/wrapper/logic
+++ b/mk/wrapper/logic
@@ -1,4 +1,4 @@
-# $NetBSD: logic,v 1.1 2004/09/21 15:01:41 jlam Exp $
+# $NetBSD: logic,v 1.2 2004/09/22 08:35:01 jlam Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -43,6 +43,10 @@ while ! queue_is_empty argbuf; do
#
argok=no
while $test "$argok" = "no"; do
+ if queue_is_empty argbuf; then
+ argok=yes
+ continue
+ fi
pop_queue argbuf arg
$debug_log $wrapperlog " (logic) pop: $arg"
#
@@ -94,10 +98,6 @@ while ! queue_is_empty argbuf; do
# Same for -Wl,-L, -Wl,-rpath and -Wl,-rpath-link.
######################################################
-Wl,-[LR])
- if queue_is_empty argbuf; then
- argok=yes
- continue
- fi
pop_queue argbuf nextarg
$debug_log $wrapperlog " (logic) pop: $nextarg"
shquote "${nextarg#-Wl,}"; nextarg="$shquoted"
@@ -105,10 +105,6 @@ while ! queue_is_empty argbuf; do
prepend_queue argbuf "$arg$nextarg"
;;
-Wl,-rpath|-Wl,-rpath-link|-Wl,--rpath)
- if queue_is_empty argbuf; then
- argok=yes
- continue
- fi
pop_queue argbuf nextarg
$debug_log $wrapperlog " (logic) pop: $nextarg"
shquote "${nextarg#-Wl,}"; nextarg="$shquoted"
@@ -129,10 +125,6 @@ while ! queue_is_empty argbuf; do
# Remove consecutive, repeated library options.
######################################################
-l*)
- if queue_is_empty argbuf; then
- argok=yes
- continue
- fi
head_queue argbuf nextarg
while $test "$nextarg" = "$arg"; do
pop_queue argbuf nextarg