Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-06-04 Thread Ravik Hasija
On Wed, Jun 3, 2020 at 5:55 AM Ravik Hasija wrote: > > Ramon Fried-4 wrote > > + if (strcmp((char *)pkt + i, "windowsize") == 0) { > > For servers that doesnt support windowsize option the above check could > > result in accessing memory outside of valid

Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-06-04 Thread Ramon Fried
On Wed, Jun 3, 2020 at 5:55 AM Ravik Hasija wrote: > > Ramon Fried-4 wrote > > + if (strcmp((char *)pkt + i, "windowsize") == 0) { > > For servers that doesnt support windowsize option the above check could > > result in accessing memory outside of valid range. Please check if

Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-06-02 Thread Ravik Hasija
Ramon Fried-4 wrote > + if (strcmp((char *)pkt + i, "windowsize") == 0) { > For servers that doesnt support windowsize option the above check could > result in accessing memory outside of valid range. Please check if (i+11) > < len before comparing the strings. > > > + > +

Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-05-23 Thread Ramon Fried
On Sat, May 23, 2020 at 8:40 PM Matthias Brugger wrote: ... > > I think it makes more sense to check: > if (tftp_window_size_option > 1 && tftp_state == STATE_SEND_RRQ) > > Because I understand that the tftp_state will change while the > tftp_window_size_option is set or at compile time or through

Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-05-23 Thread Matthias Brugger
On 19/05/2020 21:25, Ramon Fried wrote: > Add support for RFC 7440: "TFTP Windowsize Option". > > This optional feature allows the client and server > to negotiate a window size of consecutive blocks to send as an > alternative for replacing the single-block lockstep schema. > > windowsize can

Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-05-22 Thread Ramon Fried
Thanks. On Fri, May 22, 2020 at 3:29 AM rahasij wrote: > > Ramon Fried-4 wrote > > + if (strcmp((char *)pkt + i, "windowsize") == 0) { > > + tftp_windowsize = > > + simple_strtoul((char *)pkt + i + 11, > > +

Re: [PATCH v4] net: tftp: Add client support for RFC 7440

2020-05-21 Thread rahasij
Ramon Fried-4 wrote > + if (strcmp((char *)pkt + i, "windowsize") == 0) { > + tftp_windowsize = > + simple_strtoul((char *)pkt + i + 11, > +NULL, 10); > +