aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/capi/capidrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/capi/capidrv.c')
-rw-r--r--drivers/isdn/capi/capidrv.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index 2978bdaa6b8..e54e79d4e2c 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -1515,8 +1515,13 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
1515 while (*s) { 1515 while (*s) {
1516 int digit1 = 0; 1516 int digit1 = 0;
1517 int digit2 = 0; 1517 int digit2 = 0;
1518 if (!isdigit(*s)) return -3; 1518 char *endp;
1519 while (isdigit(*s)) { digit1 = digit1*10 + (*s - '0'); s++; } 1519
1520 digit1 = simple_strtoul(s, &endp, 10);
1521 if (s == endp)
1522 return -3;
1523 s = endp;
1524
1520 if (digit1 <= 0 || digit1 > 30) return -4; 1525 if (digit1 <= 0 || digit1 > 30) return -4;
1521 if (*s == 0 || *s == ',' || *s == ' ') { 1526 if (*s == 0 || *s == ',' || *s == ' ') {
1522 bmask |= (1 << digit1); 1527 bmask |= (1 << digit1);
@@ -1526,8 +1531,12 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
1526 } 1531 }
1527 if (*s != '-') return -5; 1532 if (*s != '-') return -5;
1528 s++; 1533 s++;
1529 if (!isdigit(*s)) return -3; 1534
1530 while (isdigit(*s)) { digit2 = digit2*10 + (*s - '0'); s++; } 1535 digit2 = simple_strtoul(s, &endp, 10);
1536 if (s == endp)
1537 return -3;
1538 s = endp;
1539
1531 if (digit2 <= 0 || digit2 > 30) return -4; 1540 if (digit2 <= 0 || digit2 > 30) return -4;
1532 if (*s == 0 || *s == ',' || *s == ' ') { 1541 if (*s == 0 || *s == ',' || *s == ' ') {
1533 if (digit1 > digit2) 1542 if (digit1 > digit2)