BIND 10 #363: "H" and "I" are probably harmful for PyArg_ParseTuple()
BIND 10 Development
do-not-reply at isc.org
Thu Apr 7 08:57:38 UTC 2011
#363: "H" and "I" are probably harmful for PyArg_ParseTuple()
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner: jinmei
Type: defect | Status: reviewing
Priority: minor | Milestone:
Component: | Sprint-20110419
DNSPacket API | Resolution:
Keywords: | Sensitive: 0
Estimated Number of Hours: 0.0 | Add Hours to Ticket: 0
Billable?: 1 | Total Hours: 0
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by zzchen_pku):
* owner: zzchen_pku => jinmei
Comment:
Replying to [comment:18 jinmei]:
> First off: I made a minor cleanup and pushed it to the branch:
> 21718d6 [trac363] cleanup: removed a white space at EOL.
Thanks.
> Either you didn't take my point or I was not clear enough. What I meant
was that it would make more sense to update, e.g., MessageImpl::init() so
that it would reject invalid "mode":
>
> {{{
> MessageImpl::init() {
> if (mode_ != Message::PARSE || mode_ != Message::RENDER) {
> isc_throw(something);
> }
> ...
> }
> }}}
>
> and remove the checks in the python wrapper (like the above if-else if-
else).
>
> And, such updates would be beyond the scope of this ticket, and it would
make more sense to leave them to a separate ticket.
Got it :), I have created #842 for it.
> One more thing. I suspect the limitation in
MessageRenderer_setLengthLimit() is too restrictive because the
corresponding libdns++ backend expects size_t. I'd simply reject negative
value.
Updated.
> From a quick eye-grep, no, but the point is that it would be safer to
make it sure by tests. Boundary conditions are one of the common points
where human beings make mistakes.
Refined the unittest and added more boundary test cases.
--
Ticket URL: <https://bind10.isc.org/ticket/363#comment:20>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list