From 8de1c75df0455f69a5f9a2e877ad788dbe82f1d7 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 25 Nov 2008 19:59:15 +0000 Subject: Validate that the span priority is valid in the tor2 driver. Patch provided by tzafrir. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5383 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/tor2.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/dahdi/tor2.c') diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c index d89191f..6e443b9 100644 --- a/drivers/dahdi/tor2.c +++ b/drivers/dahdi/tor2.c @@ -200,6 +200,11 @@ static int tor2_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) if (debug) printk(KERN_INFO "Tor2: Configuring span %d\n", span->spanno); + if ((lc->sync < 0) || (lc->sync >= MAX_TOR_CARDS)) { + printk(KERN_WARNING "%s %d: invalid span timing value %d.\n", + THIS_MODULE->name, span->spanno, lc->sync); + return -EINVAL; + } span->syncsrc = p->tor->syncsrc; /* remove this span number from the current sync sources, if there */ -- cgit v1.2.3