]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] 2.5.3 ISDN undefined behavior fix
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Tue, 5 Feb 2002 09:50:04 +0000 (01:50 -0800)
committerKai Germaschewski <kai@chaos.tp1.ruhr-uni-bochum.de>
Tue, 5 Feb 2002 09:50:04 +0000 (01:50 -0800)
the appended patch fixes a case of undefined behavior, found by
Urs Thuermann and "VDA".

drivers/isdn/isdn_audio.c

index 164d3a16046855ca4b2807d26c00a36560ee3462..7f848fe7ba82ff2f22e926bb9d646857193d567d 100644 (file)
@@ -227,8 +227,10 @@ isdn_audio_tlookup(const u_char *table, u_char *buff, unsigned long n)
        :       "0"((long) table), "1"(n), "2"((long) buff), "3"((long) buff)
        :       "memory", "ax");
 #else
-       while (n--)
-               *buff++ = table[*(unsigned char *)buff];
+       while (n--) {
+               *buff = table[*buff];
+               buff++;
+       }
 #endif
 }