From 181b8583e44e141b6fb585fa69bf78a5c0962c2f Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 26 Jul 2011 18:23:47 -0400 Subject: [PATCH] --- yaml --- r: 261996 b: refs/heads/master c: 91d065c47317cd5f6577fa077cca3383c8d9243d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/cifs/cifssmb.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e4089cd124c8..2936eb6360ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 998d6fcb24d25b7889ec39118cf98d5089ac4c11 +refs/heads/master: 91d065c47317cd5f6577fa077cca3383c8d9243d diff --git a/trunk/fs/cifs/cifssmb.c b/trunk/fs/cifs/cifssmb.c index 1a9fe7f816d1..0580da1cf34c 100644 --- a/trunk/fs/cifs/cifssmb.c +++ b/trunk/fs/cifs/cifssmb.c @@ -5720,6 +5720,7 @@ CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, char *temp_ptr; char *end_of_smb; __u16 params, byte_count, data_offset; + unsigned int ea_name_len; cFYI(1, "In Query All EAs path %s", searchName); QAllEAsRetry: @@ -5814,6 +5815,10 @@ CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, list_len -= 4; temp_fea = ea_response_data->list; temp_ptr = (char *)temp_fea; + + if (ea_name) + ea_name_len = strlen(ea_name); + while (list_len > 0) { unsigned int name_len; __u16 value_len; @@ -5837,7 +5842,8 @@ CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, } if (ea_name) { - if (strncmp(ea_name, temp_ptr, name_len) == 0) { + if (ea_name_len == name_len && + strncmp(ea_name, temp_ptr, name_len) == 0) { temp_ptr += name_len + 1; rc = value_len; if (buf_size == 0)