Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2007 09:30:36 GMT
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        rrs@FreeBSD.org
Subject:   bin/117175: Incorrect format strings in netstat/sctp.c
Message-ID:  <200710140930.l9E9UamK092213@freefall.freebsd.org>
Resent-Message-ID: <200710140940.l9E9e0tl093026@freefall.freebsd.org>

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

>Number:         117175
>Category:       bin
>Synopsis:       Incorrect format strings in netstat/sctp.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 14 09:40:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Yar Tikhiy
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
none
>Environment:
	CURRENT, 7-STABLE.

	
>Description:
	src/usr.bin/netstat/sctp.c tries to printf grammatically
	correct phrases by guessing singular or plural for counter
	names.  However, some of the format strings are funny.
	Presumably they were mechanically generated and were not
	proofed afterwards.

>How-To-Repeat:

Note gems like "ho%st" or "%sctp" in what follows:

yar@jujik:/usr/src/usr.bin/netstat$grep -n "%s[a-z]" sctp.c
552:    p(sctps_recvivalkeyid, "\t\t%ju invalid %secret ids received\n");
554:    p(sctps_recvexpress, "\t\t%ju fa%st path receives all one chunk\n");
555:    p(sctps_recvexpressm, "\t\t%ju fa%st path multi-part data\n");
563:    p(sctps_sendretransdata, "\t\t%ju retran%smitted DATA chunks\n");
564:    p(sctps_sendfastretrans, "\t\t%ju fa%st retransmitted DATA chunks\n");
577:    p(sctps_pdrpfehos, "\t\t%ju from end ho%st\n");
580:    p(sctps_pdrpbwrpt, "\t\t%ju non-endho%st, bandwidth rep only\n");
583:    p(sctps_pdrppdbrk, "\t\t%ju where proce%ss_chunk_drop said break\n");
585:    p(sctps_pdrpdnfnd, "\t\t%ju attempt rever%se TSN lookup\n");
586:    p(sctps_pdrpdiwnp, "\t\t%ju e-ho%st confirms zero-rwnd\n");
599:    p(sctps_timosack, "\t\t%ju %sack timers fired\n");
600:    p(sctps_timoshutdown, "\t\t%ju %shutdown timers fired\n");
606:    p(sctps_timoshutdownack, "\t\t%ju %shutdown ack timers fired\n");
607:    p(sctps_timoshutdownguard, "\t\t%ju %shutdown guard timers fired\n");
608:    p(sctps_timostrmrst, "\t\t%ju %stream reset timers fired\n");
612:    p(sctps_timoassockill, "\t\t%ju a%soc free timers expired\n");
619:    p(sctps_earlyfrstart, "\t%ju TODO:%sctps_earlyfrstart\n");
621:    p(sctps_earlyfrmrkretrans, "\t%ju TODO:%sctps_earlyfrmrkretrans\n");
622:    p(sctps_earlyfrstpout, "\t%ju TODO:%sctps_earlyfrstpout\n");
623:    p(sctps_earlyfrstpidsck1, "\t%ju TODO:%sctps_earlyfrstpidsck1\n");
624:    p(sctps_earlyfrstpidsck2, "\t%ju TODO:%sctps_earlyfrstpidsck2\n");
625:    p(sctps_earlyfrstpidsck3, "\t%ju TODO:%sctps_earlyfrstpidsck3\n");
626:    p(sctps_earlyfrstpidsck4, "\t%ju TODO:%sctps_earlyfrstpidsck4\n");
627:    p(sctps_earlyfrstrid, "\t%ju TODO:%sctps_earlyfrstrid\n");
628:    p(sctps_earlyfrstrout, "\t%ju TODO:%sctps_earlyfrstrout\n");
629:    p(sctps_earlyfrstrtmr, "\t%ju TODO:%sctps_earlyfrstrtmr\n");
635:    p(sctps_hdrops, "\t%ju packet %shorter than header\n");
636:    p(sctps_badsum, "\t%ju check%sum error\n");
644:    p(sctps_markedretrans, "\t%ju TODO:%sctps_markedretrans\n");
646:    p(sctps_naglesent, "\t%ju RFC813 allowed %sending\n");
648:    p(sctps_maxburstqueued, "\t%ju max bur%st dosn't allow sending\n");
662:    p(sctps_vtagexpress, "\t%ju u%sed express lookup via vtag\n");
663:    p(sctps_vtagbogus, "\t%ju colli%sion in express lookup.\n");
668:    p(sctps_wu_sacks_sent, "\t%ju window update only %sacks sent\n");
669:    p(sctps_sends_with_flags, "\t%ju %sends with sinfo_flags !=0\n");
670:    p(sctps_sends_with_unord, "\t%ju unordered %sends\n");
671:    p(sctps_sends_with_eof, "\t%ju %sends with EOF flag set\n");
672:    p(sctps_sends_with_abort, "\t%ju %sends with ABORT flag set\n");
678:    p(sctps_cached_strmoq, "\t%ju cached %stream oq's used\n");
679:    p(sctps_left_abandon, "\t%ju unread me%ssage abandonded by close\n");
680:    p(sctps_send_burst_avoid, "\t%ju send bur%st avoidance, already "
683:        "max bur%st inflight to net\n");

>Fix:

	Move the %s's to where plural suffixes actually should be
	in the phrases.
>Release-Note:
>Audit-Trail:
>Unformatted:



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