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


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

Submitted by:  Ben Asselstine <benasselstine>
Submitted on:  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: 

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

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 benasselstine@gmail.com

Back to the top

Powered by Savane 3.6