]> granicus.if.org Git - shadow/commitdiff
also check upper for wrap
authorSerge Hallyn <serge@hallyn.com>
Fri, 5 Aug 2016 22:16:48 +0000 (17:16 -0500)
committerSerge Hallyn <serge@hallyn.com>
Mon, 15 Aug 2016 02:48:45 +0000 (21:48 -0500)
libmisc/idmapping.c

index f105a4125997df9e48cf15f8bdf39cba37b00824..625a07a0f256c57509fd98bbd60c68bfa0b2642d 100644 (file)
@@ -89,7 +89,8 @@ struct map_range *get_map_ranges(int ranges, int argc, char **argv)
                        free(mappings);
                        return NULL;
                }
-               if (mapping->lower + mapping->count < mapping->lower) {
+               if (mapping->lower + mapping->count < mapping->lower ||
+                               mapping->upper + mapping->count < mapping->upper) {
                        free(mapping);
                        return NULL;
                }