curl-library
[PATCH] upload: Avoid infinite loop when checking for auth bits
From: Tor Arntsen <tor_at_spacetec.no>
Date: Wed, 7 Jul 2010 11:55:31 +0200
Date: Wed, 7 Jul 2010 11:55:31 +0200
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.htmlReceived on 2001-09-17