diff packages/redboot/current/src/fs/fileio.c @ 1605:43a89c18d005

Add checking (assert) for size of option arrays. Also fix port for TFTP on little endian systems.
author gthomas
date Fri, 23 Apr 2004 20:38:17 +0000
parents d177755187d3
children 549e69d9a7d0
line wrap: on
line diff
--- a/packages/redboot/current/src/fs/fileio.c
+++ b/packages/redboot/current/src/fs/fileio.c
@@ -9,7 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-// Copyright (C) 2002, 2003 Gary Thomas
+// Copyright (C) 2002, 2003, 2004 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
@@ -69,6 +69,7 @@
 #include <cyg/io/config_keys.h>
 #endif
 #include <cyg/fileio/fileio.h>
+#include <cyg/infra/cyg_ass.h>         // assertion macros
 
 static void do_mount(int argc, char *argv[]);
 static void do_umount(int argc, char *argv[]);
@@ -111,6 +112,8 @@ do_mount(int argc, char *argv[])
     num_opts++;
 #endif
 
+    CYG_ASSERT(num_opts <= NUM_ELEMS(opts), "Too many options");
+
     if (!scan_opts(argc, argv, 1, opts, num_opts, NULL, 0, NULL))
         return;