Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 06:22:10 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337065 - head/stand/libsa
Message-ID:  <201808020622.w726MAa4081963@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Thu Aug  2 06:22:10 2018
New Revision: 337065
URL: https://svnweb.freebsd.org/changeset/base/337065

Log:
  libsa: dereferencing type-punned pointer in cd9660
  
  The warning is given by gcc build, but it is good to fix anyhow.
  use bcopy instead of direct assignment.

Modified:
  head/stand/libsa/cd9660.c
  head/stand/libsa/cd9660read.c

Modified: head/stand/libsa/cd9660.c
==============================================================================
--- head/stand/libsa/cd9660.c	Thu Aug  2 03:13:59 2018	(r337064)
+++ head/stand/libsa/cd9660.c	Thu Aug  2 06:22:10 2018	(r337065)
@@ -304,7 +304,7 @@ cd9660_open(const char *path, struct open_file *f)
 	if (isonum_723(vd->logical_block_size) != ISO_DEFAULT_BLOCK_SIZE)
 		goto out;
 
-	rec = *(struct iso_directory_record *) vd->root_directory_record;
+	bcopy(vd->root_directory_record, &rec, sizeof(rec));
 	if (*path == '/') path++; /* eat leading '/' */
 
 	first = 1;

Modified: head/stand/libsa/cd9660read.c
==============================================================================
--- head/stand/libsa/cd9660read.c	Thu Aug  2 03:13:59 2018	(r337064)
+++ head/stand/libsa/cd9660read.c	Thu Aug  2 06:22:10 2018	(r337065)
@@ -241,7 +241,7 @@ cd9660_lookup(const char *path)
 			break;
 	}
 
-	rec = *(struct iso_directory_record *) vd->root_directory_record;
+	bcopy(vd->root_directory_record, &rec, sizeof(rec));
 	if (*path == '/') path++; /* eat leading '/' */
 
 	first = 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808020622.w726MAa4081963>