Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
melonDS
Commits
660792d6
Commit
660792d6
authored
Aug 19, 2020
by
Arisotura
Browse files
wifi:
* don't receive packets if the RX buffer is zero-sized * avoid potential out-of-bound writes
parent
c9447935
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Wifi.cpp
View file @
660792d6
...
...
@@ -816,6 +816,9 @@ bool CheckRX(bool block)
if
(
!
(
IOPORT
(
W_RXCnt
)
&
0x8000
))
return
false
;
if
(
IOPORT
(
W_RXBufBegin
)
==
IOPORT
(
W_RXBufEnd
))
return
false
;
u16
framelen
;
u16
framectl
;
u8
txrate
;
...
...
@@ -1049,7 +1052,7 @@ void USTimer(u32 param)
if
(
!
(
RXTime
&
RXHalfwordTimeMask
))
{
u16
addr
=
IOPORT
(
W_RXTXAddr
)
<<
1
;
*
(
u16
*
)
&
RAM
[
addr
]
=
*
(
u16
*
)
&
RXBuffer
[
RXBufferPtr
];
if
(
addr
<
0x1FFF
)
*
(
u16
*
)
&
RAM
[
addr
]
=
*
(
u16
*
)
&
RXBuffer
[
RXBufferPtr
];
IncrementRXAddr
(
addr
);
RXBufferPtr
+=
2
;
...
...
@@ -1146,7 +1149,7 @@ void RFTransfer_Type3()
// TODO: wifi waitstates
u16
Read
(
u32
addr
)
{
{
//printf("WIFI READ %08X\n", addr);
if
(
addr
>=
0x04810000
)
return
0
;
...
...
@@ -1236,7 +1239,7 @@ u16 Read(u32 addr)
}
void
Write
(
u32
addr
,
u16
val
)
{
{
//printf("WIFI WRITE %08X %04X\n", addr, val);
if
(
addr
>=
0x04810000
)
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment