aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index b004fef0a42b..741ff0c69f37 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2451,12 +2451,14 @@ findFirstRetry:
2451 name_len += 2; 2451 name_len += 2;
2452 } else { /* BB add check for overrun of SMB buf BB */ 2452 } else { /* BB add check for overrun of SMB buf BB */
2453 name_len = strnlen(searchName, PATH_MAX); 2453 name_len = strnlen(searchName, PATH_MAX);
2454 name_len++; /* trailing null */
2455/* BB fix here and in unicode clause above ie 2454/* BB fix here and in unicode clause above ie
2456 if(name_len > buffersize-header) 2455 if(name_len > buffersize-header)
2457 free buffer exit; BB */ 2456 free buffer exit; BB */
2458 strncpy(pSMB->FileName, searchName, name_len); 2457 strncpy(pSMB->FileName, searchName, name_len);
2459 pSMB->FileName[name_len] = 0; /* just in case */ 2458 pSMB->FileName[name_len] = '\\';
2459 pSMB->FileName[name_len+1] = '*';
2460 pSMB->FileName[name_len+2] = 0;
2461 name_len += 3;
2460 } 2462 }
2461 2463
2462 params = 12 + name_len /* includes null */ ; 2464 params = 12 + name_len /* includes null */ ;