Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/newfs_udf Fix endian issues with UDF extended attributes



details:   https://anonhg.NetBSD.org/src/rev/073409335158
branches:  trunk
changeset: 365745:073409335158
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Fri Apr 22 21:22:14 2022 +0000

description:
Fix endian issues with UDF extended attributes

diffstat:

 sbin/newfs_udf/udf_core.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r f5b5a0c88356 -r 073409335158 sbin/newfs_udf/udf_core.c
--- a/sbin/newfs_udf/udf_core.c Fri Apr 22 21:21:20 2022 +0000
+++ b/sbin/newfs_udf/udf_core.c Fri Apr 22 21:22:14 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_core.c,v 1.3 2022/04/22 20:56:46 reinoud Exp $ */
+/* $NetBSD: udf_core.c,v 1.4 2022/04/22 21:22:14 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2021, 2022 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: udf_core.c,v 1.3 2022/04/22 20:56:46 reinoud Exp $");
+__RCSID("$NetBSD: udf_core.c,v 1.4 2022/04/22 21:22:14 reinoud Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -2269,11 +2269,11 @@
                if ((a_l == 0) || (a_l > l_ea))
                        return EINVAL;
 
-               if (attrhdr->type != sattr)
+               if (udf_rw32(attrhdr->type) != sattr)
                        goto next_attribute;
 
                /* we might have found it! */
-               if (attrhdr->type < 2048) {     /* Ecma-167 attribute */
+               if (udf_rw32(attrhdr->type) < 2048) {   /* Ecma-167 attribute */
                        *offsetp = offset;
                        *lengthp = a_l;
                        return 0;               /* success */



Home | Main Index | Thread Index | Old Index