grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] progress: Check for NULL filename
@ 2015-08-12 15:53 dann frazier
  2015-08-13  7:52 ` Andrei Borzenkov
  0 siblings, 1 reply; 9+ messages in thread
From: dann frazier @ 2015-08-12 15:53 UTC (permalink / raw)
  To: grub-devel

Avoid a NULL pointer dereference if the upper fs layer hasn't set the
file->name field. Files opened through the grub_net_fs interface currently do
not have this field set (though perhaps they should?).

Signed-off-by: dann frazier <dann.frazier@canonical.com>
---
 grub-core/lib/progress.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/grub-core/lib/progress.c b/grub-core/lib/progress.c
index 63a0767..2775554 100644
--- a/grub-core/lib/progress.c
+++ b/grub-core/lib/progress.c
@@ -70,8 +70,7 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)),
 	percent = grub_divmod64 (100 * file->progress_offset,
 				 file->size, 0);
 
-      partial_file_name = grub_strrchr (file->name, '/');
-      if (partial_file_name)
+      if (file->name && (partial_file_name = grub_strrchr (file->name, '/')))
 	partial_file_name++;
       else
 	partial_file_name = "";
-- 
2.5.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-10 14:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-12 15:53 [PATCH] progress: Check for NULL filename dann frazier
2015-08-13  7:52 ` Andrei Borzenkov
2015-08-13 21:04   ` dann frazier
2015-08-17 18:49     ` Andrei Borzenkov
2015-08-17 21:57       ` [PATCH] Avoid NULL pointer dereference in progress module dann frazier
2015-08-20 17:55         ` Andrei Borzenkov
2015-08-21 14:24           ` Dann Frazier
2015-09-21 15:11             ` Dann Frazier
2015-10-10  8:44               ` Andrei Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).