binarycrusader / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Libproxy is going in infinite loop in using ignore when 2 comma are used in ignore string #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
On OSX, in "bypass proxy setting for" text field, 
when the string "aaa, bbb, ccc" is used ,

/* Check our ignore patterns _/ for (vector::iterator it=ignores.begin() ; it != ignores.end() && !ignored ; it++)

goes in infinite loop.
Its failing to handle two comma (,) in the ignore string.

What is the expected output? What do you see instead?
"Using ignore:" is hanging/infinite loop
It should come to "config is:" after that.

What version of the product are you using? On what operating system?
rev 661 on OSX 10.5

Please provide any additional information below.
1. Please see the image attached for the settings for OSX
2. For the string "aaa,bbb" it works fine.

Thank you
Parimal Das

Original issue reported on code.google.com by parimal....@gmail.com on 13 Apr 2010 at 11:29

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 111 has been merged into this issue.

Original comment by dominiqu...@gmail.com on 23 Apr 2010 at 8:01

GoogleCodeExporter commented 9 years ago
the gnome plugin is also affected as reported in Issue 111. 

Original comment by dominiqu...@gmail.com on 23 Apr 2010 at 8:02

GoogleCodeExporter commented 9 years ago
ping. Please, fix this blocker bug.

Original comment by A.Shaba...@gmail.com on 6 May 2010 at 9:35

GoogleCodeExporter commented 9 years ago
These are the lines 245 to 250 of proxy.cpp

==========================
        for (vector<ignore_extension*>::iterator it=ignores.begin() ; it !=
ignores.end() && !ignored ; it++)
                        if ((*it)->ignore(*realurl, 
confign.substr(i,
confign.find(','))))
                                ignored = true;
        }
        if (!ignored && invign) goto do_return;
        if (ignored && !invign) goto do_return;

==========================

Add "confign = confign.substr(i);" as shown below.

==========================

for (vector<ignore_extension*>::iterator it=ignores.begin() ; it != 
ignores.end() &&
!ignored ; it++)
  if ((*it)->ignore(*realurl, confign.substr(i, confign.find(','))))
        ignored = true;

    confign = confign.substr(i);
    
   }
        
   if (!ignored && invign) goto do_return;
   if (ignored && !invign) goto do_return;

==========================

This will solve the bug.
Without that it is always getting initialized not incremented.
I am working with this fix on OSX 10.5+

HTH
Parimal Das

Original comment by parimal....@gmail.com on 6 May 2010 at 9:58

GoogleCodeExporter commented 9 years ago
Reworked in r666. Also took time to reduce number of copies dues to excessive
substr() calls.

Original comment by nicolas.dufresne@gmail.com on 17 May 2010 at 9:29

GoogleCodeExporter commented 9 years ago

Original comment by nicolas.dufresne@gmail.com on 18 May 2010 at 3:03