2011-08-04 12:49:56

by Slawomir Bochenski

[permalink] [raw]
Subject: [PATCH obexd] Add Name header check to ftp_chkput

Validation of Name header was missing from ftp_chkput, thus still allowing
actual putting.
---
plugins/ftp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/plugins/ftp.c b/plugins/ftp.c
index 57b187c..b0ef540 100644
--- a/plugins/ftp.c
+++ b/plugins/ftp.c
@@ -267,6 +267,9 @@ int ftp_chkput(struct obex_session *os, void *user_data)
if (name == NULL)
return -EBADR;

+ if (!is_filename(name))
+ return -EBADR;
+
if (obex_get_size(os) == OBJECT_SIZE_DELETE)
return 0;

--
1.7.4.1



2011-08-04 12:58:50

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH obexd] Add Name header check to ftp_chkput

Hi Slawek,

On Thu, Aug 04, 2011, Slawomir Bochenski wrote:
> Validation of Name header was missing from ftp_chkput, thus still allowing
> actual putting.
> ---
> plugins/ftp.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)

Applied. Thanks.

Johan