From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 7 Oct 2013 08:12:52 -0400 Subject: [U-Boot] fs/fs.c - error handling needed? In-Reply-To: <20131005194941.1BCEF380A3C@gemini.denx.de> References: <20131005194941.1BCEF380A3C@gemini.denx.de> Message-ID: <20131007121252.GS15917@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Oct 05, 2013 at 09:49:41PM +0200, Wolfgang Denk wrote: > Dear Simon, > > with commit a8f6ab5 "fs: Add support for saving data to filesystems" > you add the function do_save() to U-Boot. This includes the following > code (line numbers as of current master): > > "fs/fs.c": > > ... > 331 filename = argv[3]; > 332 addr = simple_strtoul(argv[4], NULL, cmdline_base); > 333 bytes = simple_strtoul(argv[5], NULL, cmdline_base); > 334 if (argc >= 7) > 335 pos = simple_strtoul(argv[6], NULL, cmdline_base); > 336 else > 337 pos = 0; > > > Should we not perform at least minimal error checking, i. e. verify > that no garbage arguments have been passed to that function? Yes, we ought to. If you don't pass fatwrite the right number of arguments we get data aborts, for example. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: