Serious bug in Thomas Roell's X386 V1.1 (10Feb91) byteorder.s
John L. Wehle
john at feith1.UUCP
Sun May 26 12:54:58 AEST 1991
The routines contain in server/ddx/at386/bsdemul/byteorder.s
have a serious problem in that they violate C calling conventions
by removing the passed parameter from the stack. Enclosed is
a patch which fixes this problem.
*** server/ddx/at386/bsdemul/byteorder.s.orig Sat May 25 22:36:52 1991
--- server/ddx/at386/bsdemul/byteorder.s Sat May 25 22:14:29 1991
***************
*** 33,38 ****
--- 33,39 ----
htons:
popl %ecx /* get return address */
popl %eax /* param */
+ pushl %eax /* fix stack */
xchgb %al,%ah /* swap */
jmp *%ecx /* return */
***************
*** 45,50 ****
--- 46,52 ----
htonl:
popl %ecx /* get return address */
popl %eax /* param */
+ pushl %eax /* fix stack */
xchgb %al,%ah /* swap lower bytes */
rorl $16,%eax /* swap words */
xchgb %al,%ah /* swap higher bytes */
--
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john at feith1.UUCP |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
More information about the Comp.unix.sysv386
mailing list