[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #15936] improper use of fmt_seconds, etc., in libps/spec.c
From: |
Ben Asselstine |
Subject: |
[bug #15936] improper use of fmt_seconds, etc., in libps/spec.c |
Date: |
Wed, 1 Mar 2006 02:25:41 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Debian/1.7.12-1.1 |
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: benasselstine@gmail.com
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
------------------------------------+-----------------------------
benasselstine@gmail.com | 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/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #15936] improper use of fmt_seconds, etc., in libps/spec.c,
Ben Asselstine <=