/*
fill a single entry in a search find reply
*/
-static void find_fill_info(struct smbsrv_request *req,
+static BOOL find_fill_info(struct smbsrv_request *req,
union smb_search_data *file)
{
char *p;
+
+ if (req->out.data_size + 43 > req_max_data(req)) {
+ return False;
+ }
req_grow_data(req, req->out.data_size + 43);
p = req->out.data + req->out.data_size - 43;
memset(p+30, ' ', 12);
memcpy(p+30, file->search.name, MIN(strlen(file->search.name)+1, 12));
SCVAL(p,42,0);
+
+ return True;
}
/* callback function for search first/next */
{
struct search_state *state = (struct search_state *)private;
- find_fill_info(state->req, file);
-
- return True;
+ return find_fill_info(state->req, file);
}
/****************************************************************************