Skip to content

Commit 569513d

Browse files
committed
omftools: fix unaligned memory access
1 parent 2835344 commit 569513d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

bld/omftools/c/misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ unsigned_32 GetOffset( bool wide )
297297
if( wide ) {
298298
unsigned_32 dword;
299299

300-
dword = MGET_LE_U32( ReadRecPtr );
300+
dword = MGET_LE_U32_UN( ReadRecPtr );
301301
ReadRecPtr += sizeof( unsigned_32 );
302302
return( dword );
303303
} else {
304304
unsigned_16 word;
305305

306-
word = MGET_LE_U16( ReadRecPtr );
306+
word = MGET_LE_U16_UN( ReadRecPtr );
307307
ReadRecPtr += sizeof( unsigned_16 );
308308
return( word );
309309
}

bld/omftools/c/objchg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2002-2020 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2002-2026 The Open Watcom Contributors. All Rights Reserved.
66
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
*
88
* ========================================================================
@@ -113,10 +113,10 @@ static char *PutOffset( char *p, unsigned_32 data )
113113
/*************************************************/
114114
{
115115
if( RecHdr[0] & 1 ) {
116-
MPUT_LE_32( p, data );
116+
MPUT_LE_32_UN( p, data );
117117
p += sizeof( unsigned_32 );
118118
} else {
119-
MPUT_LE_16( p, data );
119+
MPUT_LE_16_UN( p, data );
120120
p += sizeof( unsigned_16 );
121121
}
122122
return( p );

0 commit comments

Comments
 (0)