inspect: Refuse to download software hive if it is huge.
[libguestfs.git] / daemon / parted.c
index 89cc0d6..068384e 100644 (file)
@@ -378,6 +378,14 @@ do_part_get_parttype (const char *device)
     }
 
     free_strings (lines);
+
+    /* If "loop" return an error (RHBZ#634246). */
+    if (STREQ (r, "loop")) {
+      free (r);
+      reply_with_error ("not a partitioned device");
+      return NULL;
+    }
+
     return r;
   }
   else {
@@ -406,6 +414,13 @@ do_part_get_parttype (const char *device)
       return NULL;
     }
 
+    /* If "loop" return an error (RHBZ#634246). */
+    if (STREQ (p, "loop")) {
+      free (p);
+      reply_with_error ("not a partitioned device");
+      return NULL;
+    }
+
     return p;                   /* caller frees */
   }
 }