Don't assume that we have a last_command value in an FTP conversation.

Nothing ensures that will be the case, and if we assume it is the case,
we can crash.

Bug: 13945
Change-Id: I7f6cb47da81efe219e87b06f8def65a332273480
Reviewed-on: https://code.wireshark.org/review/22939
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2017-08-04 13:12:10 -07:00
parent 97dcf87a86
commit 8d09f2a3ad
1 changed files with 1 additions and 1 deletions

View File

@ -981,7 +981,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
*/
if (code == 250) {
if (!pinfo->fd->flags.visited) {
if (p_ftp_conv) {
if (p_ftp_conv && p_ftp_conv->last_command) {
/* Explicit Change Working Directory command */
if (strncmp(p_ftp_conv->last_command, "CWD ", 4) == 0) {
process_cwd_success(p_ftp_conv, p_ftp_conv->last_command+4);