File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1098,17 +1098,18 @@ static int
10981098join_append_lineterminator (WriterObj * self )
10991099{
11001100 int terminator_len ;
1101+ char * terminator ;
11011102
11021103 terminator_len = PyString_Size (self -> dialect -> lineterminator );
11031104
11041105 /* grow record buffer if necessary */
11051106 if (!join_check_rec_size (self , self -> rec_len + terminator_len ))
11061107 return 0 ;
11071108
1108- memmove (self -> rec + self -> rec_len ,
1109- /* should not be NULL */
1110- PyString_AsString ( self -> dialect -> lineterminator ),
1111- terminator_len );
1109+ terminator = PyString_AsString (self -> dialect -> lineterminator );
1110+ if ( terminator == NULL )
1111+ return 0 ;
1112+ memmove ( self -> rec + self -> rec_len , terminator , terminator_len );
11121113 self -> rec_len += terminator_len ;
11131114
11141115 return 1 ;
You can’t perform that action at this time.
0 commit comments