ssl/statem.c:659: error: NULL_DEREFERENCE
  pointer `pre_work` last assigned on line 622 could be null and is dereferenced at line 659, column 43.
Showing all 16 steps of the trace


ssl/statem.c:604:1: start of procedure write_state_machine()
602.    * result in an NBIO event.
603.    */
604. > static enum SUB_STATE_RETURN write_state_machine(SSL *s)
605.   {
606.       STATEM *st = &s->statem;

ssl/statem.c:606:5: 
604.   static enum SUB_STATE_RETURN write_state_machine(SSL *s)
605.   {
606. >     STATEM *st = &s->statem;
607.       int ret;
608.       enum WRITE_TRAN (*transition)(SSL *s);

ssl/statem.c:612:5: 
610.       enum WORK_STATE (*post_work)(SSL *s, enum WORK_STATE wst);
611.       int (*construct_message)(SSL *s);
612. >     void (*cb) (const SSL *ssl, int type, int val) = NULL;
613.   
614.       if (s->info_callback != NULL)

ssl/statem.c:614:9: Taking false branch
612.       void (*cb) (const SSL *ssl, int type, int val) = NULL;
613.   
614.       if (s->info_callback != NULL)
               ^
615.           cb = s->info_callback;
616.       else if (s->ctx->info_callback != NULL)

ssl/statem.c:616:14: Taking true branch
614.       if (s->info_callback != NULL)
615.           cb = s->info_callback;
616.       else if (s->ctx->info_callback != NULL)
                    ^
617.           cb = s->ctx->info_callback;
618.   

ssl/statem.c:617:9: 
615.           cb = s->info_callback;
616.       else if (s->ctx->info_callback != NULL)
617. >         cb = s->ctx->info_callback;
618.   
619.       if(s->server) {

ssl/statem.c:619:8: Taking true branch
617.           cb = s->ctx->info_callback;
618.   
619.       if(s->server) {
              ^
620.           /* TODO: Fill these in later when we've implemented them */
621.           transition = NULL;

ssl/statem.c:621:9: 
619.       if(s->server) {
620.           /* TODO: Fill these in later when we've implemented them */
621. >         transition = NULL;
622.           pre_work = NULL;
623.           post_work = NULL;

ssl/statem.c:622:9: 
620.           /* TODO: Fill these in later when we've implemented them */
621.           transition = NULL;
622. >         pre_work = NULL;
623.           post_work = NULL;
624.           construct_message = NULL;

ssl/statem.c:623:9: 
621.           transition = NULL;
622.           pre_work = NULL;
623. >         post_work = NULL;
624.           construct_message = NULL;
625.       } else {

ssl/statem.c:624:9: 
622.           pre_work = NULL;
623.           post_work = NULL;
624. >         construct_message = NULL;
625.       } else {
626.           /* TODO: Fill these in later when we've implemented them */

ssl/statem.c:633:11: Loop condition is true. Entering loop body
631.       }
632.   
633.       while(1) {
                 ^
634.           switch(st->write_state) {
635.           case WRITE_STATE_TRANSITION:

ssl/statem.c:634:9: 
632.   
633.       while(1) {
634. >         switch(st->write_state) {
635.           case WRITE_STATE_TRANSITION:
636.               if (cb != NULL) {

ssl/statem.c:635:9: Switch condition is false. Skipping switch case
633.       while(1) {
634.           switch(st->write_state) {
635.           case WRITE_STATE_TRANSITION:
               ^
636.               if (cb != NULL) {
637.                   /* Notify callback of an impending state change */

ssl/statem.c:658:9: Switch condition is true. Entering switch case
656.               break;
657.   
658.           case WRITE_STATE_PRE_WORK:
               ^
659.               switch(st->write_state_work = pre_work(s, st->write_state_work)) {
660.               default:

ssl/statem.c:659:13: 
657.   
658.           case WRITE_STATE_PRE_WORK:
659. >             switch(st->write_state_work = pre_work(s, st->write_state_work)) {
660.               default:
661.                   return SUB_STATE_ERROR;
