Home
last modified time | relevance | path

Searched hist:"69 ba62925560b68945bcb4f4ea212331871ca63e" (Results 1 – 1 of 1) sorted by relevance

/freebsd/contrib/smbfs/lib/smb/
H A Dnb_name.cdiff 69ba62925560b68945bcb4f4ea212331871ca63e Mon Dec 21 18:17:00 CET 2015 Ian Lepore <ian@FreeBSD.org> Avoid unaligned memory accesses when encoding netbios names in libsmb.

The current code for encoding a netbios name converts each byte to a 16-bit
value and stores the result by casting a char* to u_short*, resulting in
alignment faults on strict-alignment platforms.

This change reimplements the encoding routine using only byte accesses to
memory. There is no particular reason to work with 16-bit values just
because the encoding process creates two bytes of output for every byte of
input. Working a byte at at time also avoids endian problems for big-endian
platforms.

PR: 180438
PR: 189415
Differential Revision: https://reviews.freebsd.org/D4622