* [patch] isofs/joliet broken on alpha
@ 2001-02-26 17:31 Ivan Kokshaysky
0 siblings, 0 replies; only message in thread
From: Ivan Kokshaysky @ 2001-02-26 17:31 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-kernel
uni16_to_x8() loads unaligned u16 words, returning bogus file names
on an ev5 and older alpha CPUs...
Ivan.
--- 2.4.2-ac4/fs/isofs/joliet.c Fri Feb 9 22:29:44 2001
+++ linux/fs/isofs/joliet.c Mon Feb 26 17:06:54 2001
@@ -10,6 +10,7 @@
#include <linux/nls.h>
#include <linux/slab.h>
#include <linux/iso_fs.h>
+#include <asm/unaligned.h>
/*
* Convert Unicode 16 to UTF8 or ASCII.
@@ -17,15 +18,15 @@
static int
uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
{
- wchar_t *ip;
+ wchar_t *ip, ch;
unsigned char *op;
ip = uni;
op = ascii;
- while (*ip && len) {
+ while ((ch = get_unaligned(ip)) && len) {
int llen;
- wchar_t ch = be16_to_cpu(*ip);
+ ch = be16_to_cpu(ch);
if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0)
op += llen;
else
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-02-26 17:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-26 17:31 [patch] isofs/joliet broken on alpha Ivan Kokshaysky
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).