bugThe GNU Hurd - Bugs: bug #15936, improper use of fmt_seconds, etc.,...

 
 

bug #15936: improper use of fmt_seconds, etc., in libps/spec.c

Submitter:  Ben Asselstine <benasselstine>
Submitted:  Wed 01 Mar 2006 02:25:40 AM UTC
   
 
Category:  Hurd Interfaces Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Ben Asselstine
Open/Closed:  Open Reproducibility:  None
Size (loc):  None Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 


* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 01 Mar 2006 02:25:40 AM UTC, original submission:  

In libshouldbeinlibc/timespec.c, fmt_minutes, fmt_seconds, and fmt_past_time do not modify their BUF output parameter if TV->tv_sec is 0, and precision is also 0.  The return value of fmt_* is set appropriately to 0 in this case.  The callers of these functions are in libps/spec.c: ps_emit_seconds, ps_emit_minutes, and ps_emit_past_time do not check the return value properly before passing on the buf parameter in ps_stream_write_field.

callers of ps_emit_seconds, ps_emit_minutes, and ps_emit_past_time don't seem to be ever use a precision of 0, but these functions should check the return values of fmt_seconds, fmt_minutes, fmt_past_time, to be complete.  By fixing this, libps would become a little bit more robust.

This bug report comes as a result of code-staring audit and not debugging a particular bug in gdb.

Ben Asselstine <benasselstine>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2006-03-01 benasselstine Carbon-Copy- Added -email is unavailable-

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code