Hylafax Developers Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-devel] Re: **BUG** DestControls broken



On 29 May, Dmitry Bely wrote:
> Darren Nickerson <darren@dazza.org> writes:
> 
>> Okay, here's what happens to faxq when I try to submit a job with a DestControl active:

Yes - fxStr protects it's data, and doesn't let a [] reference get past
the bounds (i.e. you can't get the '\0' with the [] operator).

Patch against current CVS (seems to work for me)

--- hylafax-aidan/faxd/DestControl.c++  Mon May 29 16:05:12 2000
+++ hylafax/faxd/DestControl.c++        Mon Aug 23 07:19:32 1999
@@ -222,20 +222,17 @@
 crackArgv(fxStr& s)
 {
     int i = 0;
-    u_int l = s.length();
+    u_int l = s.length()+1;            // +1 for \0
     do {
-       while (i < l && !isspace(s[i]))
-           i++;
-       if (i == l)
-           break;
-       s[i++] = '\0';
-       int j = i;
-       while ( (j < l) && isspace(s[j]))
-               j++;
-       if (j > i) {
+        while (s[i] && !isspace(s[i])) i++;
+        if (s[i] == '\0') break;
+        s[i++] = '\0';
+        int j = i;
+        while (isspace(s[j])) j++;
+       if (j > i) {
             s.remove(i, j-i);
         }
-    } while (i < l);
+    } while (s[i] != '\0');
     s.resize(i);



Also - on the topics of patches, tabs == 8 or 4?

a.

-- 
Aidan Van Dyk                                        Create like a god,
aidan@highrise.ca                                  command like a king,
http://www.highrise.ca/                              work like a slave.

   |\^/|       |\^/|       |\^/|       |\^/|       |\^/|       |\^/|
_|\|   |/|_ _|\|   |/|_ _|\|   |/|_ _|\|   |/|_ _|\|   |/|_ _|\|   |/|_
>    C    < >    a    < >    n    < >    a    < >    d    < >    a    <
 >_./|\._<   >_./|\._<   >_./|\._<   >_./|\._<   >_./|\._<   >_./|\._<


____________________ HylaFAX(tm) Developers Mailing List ____________________
 To unsub: mail -s unsubscribe hylafax-devel-request@hylafax.org < /dev/null



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services