Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jan 2012 02:03:07 GMT
From:      NAGATA Shinya <maya@negeta.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/164347: comms/lrzsz fails to send ymodem
Message-ID:  <201201210203.q0L237rg044253@red.freebsd.org>
Resent-Message-ID: <201201210210.q0L2A9g9089203@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164347
>Category:       ports
>Synopsis:       comms/lrzsz fails to send ymodem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 21 02:10:09 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     NAGATA Shinya
>Release:        FreeBSD 8.2
>Organization:
>Environment:
>Description:
YMODEM sends block0 to notify END OF TRANSFER.
But block0 includes invalid non-NULL data.
Because
struct stat f;
doesn't initialize f.st_size. The file size is exist, it is recognized as valid file transfer block.
>How-To-Repeat:
lsz --ymodem foo.txt
>Fix:
Initialize f.st_size.

Patch attached with submission follows:

--- src/lsz.c.orig	1998-12-30 07:07:59.000000000 +0900
+++ src/lsz.c	2012-01-21 10:44:49.000000000 +0900
@@ -1191,6 +1191,7 @@
 	struct stat f;
 
 	name2=alloca(PATH_MAX+1);
+	f.st_size = 0;
 
 	if (protocol==ZM_XMODEM) {
 		if (Verbose && *zi->fname && fstat(fileno(input_f), &f)!= -1) {


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201210203.q0L237rg044253>