summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-04-14 18:55:20 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-04-14 18:55:20 +0000
commit38cbe2090ef94689f646ea40d3cacb4ddf309f5a (patch)
tree7e367d76f7cb437c1595313fc42f3b626fe46943 /zaptel.c
parent41ae9e883206612835c29b2ce49b2699d7a34306 (diff)
Increase max number of sub tones
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@169 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/zaptel.c b/zaptel.c
index df42b14..02ac550 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -2062,8 +2062,8 @@ static ssize_t zt_write(struct file *file, const char *usrbuf, size_t count, lof
/* No bigger than 32k for everything per tone zone */
#define MAX_SIZE 32768
-/* No more than 30 subtones */
-#define MAX_TONES 30
+/* No more than 128 subtones */
+#define MAX_TONES 128
static int
ioctl_load_zone(unsigned long data)
@@ -2085,8 +2085,10 @@ ioctl_load_zone(unsigned long data)
/* XXX Unnecessary XXX */
memset(next, 0, sizeof(next));
copy_from_user(&th, (struct zt_tone_def_header *)data, sizeof(th));
- if ((th.count < 0) || (th.count > MAX_TONES))
+ if ((th.count < 0) || (th.count > MAX_TONES)) {
+ printk("Too many tones included\n");
return -EINVAL;
+ }
space = size = sizeof(struct zt_zone) +
th.count * sizeof(struct zt_tone);
if ((size > MAX_SIZE) || (size < 0))
@@ -2108,6 +2110,7 @@ ioctl_load_zone(unsigned long data)
if (space < sizeof(struct zt_tone)) {
/* Check space for zt_tone struct */
kfree(slab);
+ printk("Insufficient tone zone space\n");
return -EINVAL;
}
if (copy_from_user(&td, (struct zt_tone_def *)data, sizeof(struct zt_tone_def))) {
@@ -2120,10 +2123,12 @@ ioctl_load_zone(unsigned long data)
next[x] = td.next;
/* Make sure the "next" one is sane */
if ((next[x] >= th.count) || (next[x] < 0)) {
+ printk("Invalid 'next' pointer\n");
kfree(slab);
return -EINVAL;
}
if (td.tone >= ZT_TONE_MAX) {
+ printk("Too many tones defined\n");
/* Make sure it's sane */
kfree(slab);
return -EINVAL;