Skip to content

Conversation

@alficles
Copy link
Contributor

@alficles alficles commented Jul 31, 2018

This should be cherry-picked into 7 and 8, too.

char *p = NULL, *sig_anchor = NULL, *saveptr = NULL;
int i = 0, numtoks = 0, cp_len = 0, l, decoded_len = 0, sig_anchor_seg = 0;
int i = 0, numtoks = 0, decoded_len = 0, sig_anchor_seg = 0;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use nullchecks on all the things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No null checks in the old things, and my goal wasn't wholesale rewrite, but just a return to existing behavior. These are pretty safe, though, cause if we get a null ptr here, we're already in pretty bad shape much earlier.

}
}

/** fixedBufferWrite safely writes no more than *dest_len bytes to *dest_end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider using ts::FixedBufferWriter for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Is there a straight C version though? I am mostly just trying to get the code back to what it used to do before strncat got turned into memcpy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, no C version. Dang. I keep forgetting people still write code in C. Oh well, nevermind.

@bryancall bryancall added this to the 9.0.0 milestone Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants