>From 16d1af2eef9f9e3080084619f159eb3344f4d45b Mon Sep 17 00:00:00 2001
From: Tor Arntsen <[email protected]>
Date: Wed, 7 Jul 2010 11:55:31 +0200
Subject: [PATCH] upload: Avoid infinite loop when checking for auth bits

The test would loop forever if authtype bit 0 wasn't set.
---
This looks like the correct fix. Daniel, please verify.
The problem was introduced in 915032ea02
There are probably many autobuilds around looping now (those
that do 'make test' anyway), so you autobuilders out there should
take a look and kill off some processes..

 src/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index 7aa6985..60e7b59 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4925,7 +4925,7 @@ operate(struct Configurable *config, int argc, 
argv_item_t argv[])
           int authbits = 0;
           int bitcheck = 0;
           while(bitcheck < 32) {
-            if(config->authtype & (1 << bitcheck)) {
+            if(config->authtype & (1 << bitcheck++)) {
               authbits++;
               if(authbits > 1) {
                 /* more than one, we're done! */
-- 
1.7.1

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to