summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-09-22 08:35:01 +0000
committerjlam <jlam>2004-09-22 08:35:01 +0000
commit136602115238b4eecc6c0000e81bf6995871a5a3 (patch)
tree236abd649de78677c022a4b421ec6cd90c2cfbeb /mk
parent08039266e343e3cb99feb5cbfd5fd9acf006ac97 (diff)
downloadpkgsrc-136602115238b4eecc6c0000e81bf6995871a5a3.tar.gz
Protect against underflow in the argument buffer in the inner while loop,
noted in PR pkg/27014.
Diffstat (limited to 'mk')
-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