Hi!

Find 3 patches attached.

*) fix_missing_defines.patch
The freshly cloned repo doesn't compile without these defines.

*) fix_strncat_usage.patch
Resolves the issue pointed out by Martin Pirker (26 Apr 2010 14:36).

*) fix_off_by_one.patch
Assignment is always out of bounds.

Michael

diff --git a/utils/parse_err.c b/utils/parse_err.c
--- a/utils/parse_err.c
+++ b/utils/parse_err.c
@@ -48,6 +48,7 @@
 #include "../tboot/include/txt/config_regs.h"
 #include "../tboot/include/txt/errorcode.h"
 
+#define PAGE_SHIFT                  (12)
 #define TXT_CONFIG_REGS_SIZE        (NR_TXT_CONFIG_PAGES*PAGE_SIZE)
 
 static inline uint64_t read_txt_config_reg(void *config_regs_base,
diff --git a/utils/txt-stat.c b/utils/txt-stat.c
--- a/utils/txt-stat.c
+++ b/utils/txt-stat.c
@@ -69,6 +69,7 @@
     return (bios_data_t *)((char*)heap + sizeof(uint64_t));
 }
 
+#define PAGE_SHIFT                  (12)
 #define TXT_CONFIG_REGS_SIZE        (NR_TXT_CONFIG_PAGES*PAGE_SIZE)
 
 static inline uint64_t read_txt_config_reg(void *config_regs_base,
diff --git a/lcptools/crtpol.c b/lcptools/crtpol.c
--- a/lcptools/crtpol.c
+++ b/lcptools/crtpol.c
@@ -462,7 +462,7 @@
             goto _error_end;
         }
 	/* ensure that convert_hashes() won't overrun the buffer */
-	mle_data_ascii[BUFFER_SIZE] = '\0';
+	mle_data_ascii[BUFFER_SIZE - 1] = '\0';
 	/* convert ASCII hashes to binary */
 	if ( convert_hashes(mle_len_ascii, mle_data_ascii, &mle_len,
 			    mle_data) < 0 ) {
diff --git a/lcptools/crtpolelt.c b/lcptools/crtpolelt.c
--- a/lcptools/crtpolelt.c
+++ b/lcptools/crtpolelt.c
@@ -115,7 +115,7 @@
             ERROR("Error: too many plugin options\n");
 
         /* copy help text */
-        strncat(help, plugin->help_txt, MAX_HELP_TEXT);
+        strncat(help, plugin->help_txt, MAX_HELP_TEXT - strlen(help) - 1);
     }
 }
 
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel

Reply via email to