[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [git commit] pstree: stop truncating thread names
From:       Mike Frysinger <vapier () gentoo ! org>
Date:       2013-06-28 0:35:13
Message-ID: 201306272035.14498.vapier () gentoo ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 27 June 2013 19:55:32 Denys Vlasenko wrote:
> On Wednesday 19 June 2013 17:29, Mike Frysinger wrote:
> >  static void handle_thread(const char *comm, pid_t pid, pid_t ppid, uid_t
> >  uid) {
> > 
> > -	char threadname[COMM_LEN + 2];
> > -	sprintf(threadname, "{%.*s}", COMM_LEN - 2, comm);
> > +	char threadname[COMM_DISP_LEN + 1];
> > +	sprintf(threadname, "{%.*s}", (int)sizeof(threadname) - 1, comm);
> 
> ??
> 
> The size should be (int)sizeof(threadname) - 3

yeah, i was thinking about the NUL.  well, fixed one bug by adding another :).
-mike

["signature.asc" (application/pgp-signature)]

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic