Because we'll have issues with unsigned vs. signed comparisons later in
this method.
if (codeStrLen < bufSize && codeStrLen < len) {
I'm fine with casting here, but something has to be coerced so I figured
doing it this way was best.
On Thu, Nov 20, 2014 at 12:27 PM, James Peach <[email protected]> wrote:
>
> > On Nov 20, 2014, at 11:53 AM, [email protected] wrote:
> >
> > Repository: trafficserver
> > Updated Branches:
> > refs/heads/master 74d29be0e -> 90b635481
> >
> >
> > Fixing AddressSanitizer issue where sizeof(size_t) > sizeof(int).
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> > Commit:
> http://git-wip-us.apache.org/repos/asf/trafficserver/commit/90b63548
> > Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/90b63548
> > Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/90b63548
> >
> > Branch: refs/heads/master
> > Commit: 90b635481aa9a819852fbfeafdf334bf06513181
> > Parents: 74d29be
> > Author: Brian Geffon <[email protected]>
> > Authored: Thu Nov 20 11:53:24 2014 -0800
> > Committer: Brian Geffon <[email protected]>
> > Committed: Thu Nov 20 11:53:24 2014 -0800
> >
> > ----------------------------------------------------------------------
> > proxy/logging/LogAccess.cc | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/90b63548/proxy/logging/LogAccess.cc
> > ----------------------------------------------------------------------
> > diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
> > index 17cfed8..ce5f04c 100644
> > --- a/proxy/logging/LogAccess.cc
> > +++ b/proxy/logging/LogAccess.cc
> > @@ -861,7 +861,7 @@ LogAccess::marshal_ip(char* dest, sockaddr const*
> ip) {
> > inline int
> > LogAccess::unmarshal_with_map(int64_t code, char *dest, int len,
> Ptr<LogFieldAliasMap> map, const char *msg)
> > {
> > - int codeStrLen;
> > + long int codeStrLen = 0;
>
> Huh? Why not size_t?
>
> >
> > switch (map->asString(code, dest, len, (size_t *) & codeStrLen)) {
> > case LogFieldAliasMap::INVALID_INT:
> >
>
>