]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 309] +FTM responses with dashed ranges breaks our parser
authorDarren Nickerson <darren.nickerson@ifax.com>
Thu, 27 Jun 2002 14:41:49 +0000 (14:41 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Thu, 27 Jun 2002 14:41:49 +0000 (14:41 +0000)
Now we handle dashes/ranges!
CeS: Committing in .

CHANGES
faxd/Class1.c++

diff --git a/CHANGES b/CHANGES
index 64cf04ee058dab7352d016f0a2acb71d6460ce65..5087b3714ae8cc2dfd3974dc31608b14d3cafad0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,9 @@
 #      $Id$    
 
-Changelog for HylaFAX 4.1.3 - Jun 17, 2002
+Changelog for HylaFAX 4.1.3 - Jun 27, 2002
 
+* enhanced Class1Modem::parseQuery() to parse correctly +FTM responses
+  which contain item ranges (dashes) (27 Jun 2002)
 * made fixes to enable gcc v3.0 compatibility (15 Jun 2002)
 * made minor changes for Sun Forte compiler compatibility (14 Jun 2002)
 * fixed hostname format string vulnerabilities in faxrm, faxalter, 
index c314895000d0864187721deebd73d2829c91b9c2..1e78fccd2d879f83337c06641446ee39a17c3f2a 100644 (file)
@@ -941,8 +941,19 @@ Class1Modem::parseQuery(const char* cp, Class1Cap caps[])
        do {
            v = v*10 + (cp[0] - '0');
        } while (isdigit((++cp)[0]));
+       int r = v;
+       if (cp[0] == '-') {                             // <low>-<high>
+           cp++;
+           if (!isdigit(cp[0])) {
+               return (false);
+               r = 0;
+               do {
+                   r = r*10 + (cp[0] - '0');
+               } while (isdigit((++cp)[0]));
+           }
+       }
        for (u_int i = 0; i < NCAPS; i++)
-           if (caps[i].value == v) {
+           if (caps[i].value >= v && caps[i].value <= r) {
                caps[i].ok = true;
                break;
            }