URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=15936>
Summary: improper use of fmt_seconds, etc., in libps/spec.c Project: The GNU Hurd Submitted by: benasselstine Submitted on: Wed 03/01/06 at 02:25 Category: Hurd Interfaces Severity: 3 - Normal Priority: 5 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Originator Name: Ben Asselstine Originator Email: [EMAIL PROTECTED] Open/Closed: Open Reproducibility: None Size (loc): None Effort: 0.00 _______________________________________________________ Details: 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. _______________________________________________________ Carbon-Copy List: CC Address | Comment ------------------------------------+----------------------------- [EMAIL PROTECTED] | Originator Email _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=15936> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-hurd mailing list Bug-hurd@gnu.org http://lists.gnu.org/mailman/listinfo/bug-hurd