[Asterisk-code-review] CHAOS: update ast str hash to handle null ptr (asterisk[11])

Richard Mudgett asteriskteam at digium.com
Fri Aug 14 11:04:04 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: CHAOS: update ast_str_hash to handle null ptr
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/1095/1/include/asterisk/strings.h
File include/asterisk/strings.h:

Line 964: static force_inline int attribute_pure ast_str_hash(const char *str)
Making this function NULL tolerant is more likely to hide bugs rather than expose them because someone did not check an alloation return for NULL.


Line 970: 				hash = hash * 33 ^ *str++;
Indented one too many times.


-- 
To view, visit https://gerrit.asterisk.org/1095
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I89677d99bffc4bbc31a30a708e7559fdfef053db
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list