@@ -204,6 +204,9 @@ smb2_encode_query_info_reply(struct smb2_context *smb2,
204
204
(struct smb2_file_network_open_info * )rep -> output_buffer , iov );
205
205
break ;
206
206
case SMB2_FILE_NORMALIZED_NAME_INFORMATION :
207
+ created_output_buffer_length =
208
+ smb2_encode_file_normalized_name_info (smb2 ,
209
+ (struct smb2_file_name_info * )rep -> output_buffer , iov );
207
210
break ;
208
211
case SMB2_FILE_PIPE_INFORMATION :
209
212
break ;
@@ -300,6 +303,11 @@ smb2_encode_query_info_reply(struct smb2_context *smb2,
300
303
req -> info_type , req -> file_info_class );
301
304
}
302
305
} else {
306
+ if (created_output_buffer_length > req -> output_buffer_length ) {
307
+ /* truncate output buffer to what request can handle in return */
308
+ created_output_buffer_length = req -> output_buffer_length ;
309
+ smb2_set_pdu_status (smb2 , pdu , SMB2_STATUS_BUFFER_OVERFLOW );
310
+ }
303
311
iov -> len = PAD_TO_64BIT (created_output_buffer_length );
304
312
rep -> output_buffer_length = created_output_buffer_length ;
305
313
}
@@ -472,6 +480,14 @@ int smb2_process_query_info_variable(struct smb2_context *smb2,
472
480
}
473
481
break ;
474
482
case SMB2_FILE_NORMALIZED_NAME_INFORMATION :
483
+ ptr = smb2_alloc_init (smb2 ,
484
+ sizeof (struct smb2_file_name_info ));
485
+ if (smb2_decode_file_normalized_name_info (smb2 , ptr , ptr , & vec )) {
486
+ smb2_set_error (smb2 , "could not decode file "
487
+ "normalized name info. %s" ,
488
+ smb2_get_error (smb2 ));
489
+ return -1 ;
490
+ }
475
491
break ;
476
492
case SMB2_FILE_PIPE_INFORMATION :
477
493
break ;
0 commit comments