Compare commits

...

3 Commits

Author SHA1 Message Date
Laurence Withers f2462dbeab Bump version 2009-11-03 23:10:15 +00:00
Laurence Withers 22d58219e7 Bump version 2009-11-03 23:10:15 +00:00
Laurence Withers 3cfd83e1a6 Fix potential null pointer dereference
utf8_encoder() was incorrectly dereferencing the pointer `state' before testing
it against null; fix by removing the variable initialisers.
2009-11-03 23:08:55 +00:00
3 changed files with 6 additions and 4 deletions

View File

@ -10,8 +10,7 @@
struct utf8_encode_state* struct utf8_encode_state*
utf8_encoder(struct utf8_encode_state* state) utf8_encoder(struct utf8_encode_state* state)
{ {
char* wr = state->wr, * ret; char* wr, * ret, * endp;
char* endp = wr + state->wr_size - 1;
wchar_t ch; wchar_t ch;
enum utf8_encode_error_action error_action; enum utf8_encode_error_action error_action;
int reencoding; int reencoding;
@ -21,6 +20,9 @@ utf8_encoder(struct utf8_encode_state* state)
return 0; return 0;
} }
wr = state->wr;
endp = wr + state->wr_size - 1;
state->written = 0; state->written = 0;
while(state->rd_remain) { while(state->rd_remain) {
ch = *state->rd; ch = *state->rd;

View File

@ -12,4 +12,4 @@
SOMAJOR=1 SOMAJOR=1
# SOMICRO is bumped every time there is a binary-compatible release. # SOMICRO is bumped every time there is a binary-compatible release.
SOMICRO=1 SOMICRO=2

View File

@ -11,7 +11,7 @@
# expected to be in 'major.minor.micro' format. # expected to be in 'major.minor.micro' format.
VERMAJOR=1 VERMAJOR=1
VERMINOR=3 VERMINOR=3
VERMICRO=1 VERMICRO=2
# kate: replace-trailing-space-save true; space-indent true; tab-width 4; # kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4:syntax=sh # vim: expandtab:ts=4:sw=4:syntax=sh