Bug 995595
Summary: | defensive-coding-guide: Incorrect advice on array allocation | ||
---|---|---|---|
Product: | [Fedora] Fedora Documentation | Reporter: | Gé Baylard <Geodebay> |
Component: | defensive-coding-guide | Assignee: | Florian Weimer <fweimer> |
Status: | CLOSED EOL | QA Contact: | Fedora Docs QA <docs-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | devel | CC: | fweimer |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-11-07 15:30:15 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1000995 |
Description
Gé Baylard
2013-08-09 19:41:18 UTC
(In reply to Gé Baylard from comment #0) > Description of problem: > In Allocators.xml, line 135 to 138, you write: > " .... For instance, > to allocate an array of <literal>n</literal> elements of type > <literal>T</literal>, check that the requested size is not > greater than <literal>n / sizeof(T)</literal>." > > It is not rather? > " .... For instance, > to allocate an array of <literal>n</literal> elements of type > <literal>T</literal>, check that the requested size is not > smaller than <literal>n * sizeof(T)</literal>." Right, this is buggy, the expresion should be <literal>(~(size_t)0) / sizeof(T)</literal>. Thanks for spotting this. Fixed in 876a1bcbd0b2687867aded985d142df5030988ae. Thanks again. What's the status of this? Did this make it into the guide? See comment #2. The Docbook sources have been updated, but we have not been able to publish an updated HTML version. Before we can do that, we need to update the revision log. I'm closing this bug as part of a Bugzilla cleanup effort. The most likely reason is that the bug has been opened either against a component we no longer publish, or against Release Notes for an EOL release. |