]> sourceware.org Git - lvm2.git/commitdiff
Add range test for device number
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Feb 2012 12:48:14 +0000 (12:48 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Feb 2012 12:48:14 +0000 (12:48 +0000)
Check the output of atoi is in valid range.

WHATS_NEW
lib/filters/filter.c

index 2cce7dbd9ab90671991ae77dd05b7e1140039f62..3bae8ac962a58048775ae67857dd1bcbb7e18907 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.91 -
 ===================================
+  Add range test for device number in _scan_proc_dev().
   Use signed long for sysconf() call in cmirrord.
   Do not write in front of log buffer in print_log().
   Add boundary test for number of mirror devs and logs.
index d36f21b7e6547c01b5c52374ec82b9ae6b9efead..9d08a7a9eb2f94a43b804328eba0672d1b3e4bc3 100644 (file)
@@ -226,7 +226,7 @@ static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn)
 
                /* If it's not a number it may be name of section */
                line_maj = atoi(((char *) (line + i)));
-               if (!line_maj) {
+               if ((line_maj <= 0) || (line_maj >= NUMBER_OF_MAJORS)) {
                        blocksection = (line[i] == 'B') ? 1 : 0;
                        continue;
                }
This page took 0.040504 seconds and 5 git commands to generate.