| Submitter | Sergei Gavrikov |
|---|---|
| Date | Jan. 12, 2011, 7:22 a.m. |
| Message ID | <alpine.DEB.2.00.1101120911001.15581@sg-desktop.belvok.com> |
| Download | mbox | patch |
| Permalink | /patch/78517/ |
| State | New |
| Headers | show |
Comments
On Wed, Jan 12, 2011 at 7:22 AM, Sergei Gavrikov <sergei.gavrikov@gmail.com> wrote: > diff --git a/slirp/tftp.c b/slirp/tftp.c > index 55e4692..a455ad1 100644 > --- a/slirp/tftp.c > +++ b/slirp/tftp.c > @@ -311,7 +311,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen) > return; > } > > - if (memcmp(&tp->x.tp_buf[k], "octet\0", 6) != 0) { > + if (strcasecmp((const char *)&tp->x.tp_buf[k], "octet") != 0) { > tftp_send_error(spt, 4, "Unsupported transfer mode", tp); > return; > } According to RFC 2349 the "tsize" option is also case-insensitive. Want to include a fix for that in this patch? Stefan
Patch
diff --git a/slirp/tftp.c b/slirp/tftp.c index 55e4692..a455ad1 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -311,7 +311,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct tftp_t *tp, int pktlen) return; } - if (memcmp(&tp->x.tp_buf[k], "octet\0", 6) != 0) { + if (strcasecmp((const char *)&tp->x.tp_buf[k], "octet") != 0) { tftp_send_error(spt, 4, "Unsupported transfer mode", tp); return; }