diff ffstools/tiffs-rd/basics.c @ 232:73372cfdaf7f

tiffs IVA: object name validation implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 26 Jan 2014 08:42:59 +0000
parents 5ceacdbd4490
children 43642cf7c98c
line wrap: on
line diff
--- a/ffstools/tiffs-rd/basics.c	Sun Jan 26 08:11:42 2014 +0000
+++ b/ffstools/tiffs-rd/basics.c	Sun Jan 26 08:42:59 2014 +0000
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <strings.h>
 #include "types.h"
+#include "struct.h"
 #include "globals.h"
 
 u8 tiffs_header[6] = {'F', 'f', 's', '#', 0x10, 0x02};
@@ -136,5 +137,12 @@
 	alloc_inode_table();
 	find_root_inode();
 	printf("Root inode is #%x\n", root_inode);
-	exit(0);
+	if (validate_obj_name(root_inode, 1)) {
+		printf("Root inode (format) name: %s\n",
+			inode_info[root_inode]->dataptr);
+		exit(0);
+	} else {
+		printf("No valid name found in the root inode!\n");
+		exit(1);
+	}
 }