[libmultipath] add vector_del_slot() checks
authorChristophe Varoqui <root@xa-s05.(none)>
Sat, 29 Oct 2005 14:26:51 +0000 (16:26 +0200)
committerChristophe Varoqui <root@xa-s05.(none)>
Sat, 29 Oct 2005 14:26:51 +0000 (16:26 +0200)
Verify that the slot number we where asked to delete is not "< 0" nor
"> VECTOR_SIZE()".

libmultipath/vector.c

index a529557..d7459ee 100644 (file)
@@ -80,7 +80,7 @@ vector_del_slot(vector v, int slot)
 {
        int i;
 
-       if (!v->allocated)
+       if (!v->allocated || slot < 0 || slot > VECTOR_SIZE(v))
                return;
 
        for (i = slot + 1; i < (v->allocated / VECTOR_DEFAULT_SIZE); i++)