Skip to content

Commit 64fe4c1

Browse files
committed
Add a comment about possible NULL pointer in string encoder
Fixes ged#580
1 parent 764f6d5 commit 64fe4c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/pg_text_encoder.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ pg_text_enc_boolean(t_pg_coder *this, VALUE value, char *out, VALUE *intermediat
119119
int
120120
pg_coder_enc_to_s(t_pg_coder *this, VALUE value, char *out, VALUE *intermediate, int enc_idx)
121121
{
122+
/* Attention:
123+
* In contrast to all other encoders, the "this" pointer of this encoder can be NULL.
124+
* This is because it is used as a fall-back if no encoder is defined.
125+
*/
122126
VALUE str = rb_obj_as_string(value);
123127
if( ENCODING_GET(str) == enc_idx ){
124128
*intermediate = str;

0 commit comments

Comments
 (0)