Lines 786-792
Link Here
|
786 |
static int hextab_initialized = 0; |
786 |
static int hextab_initialized = 0; |
787 |
static char *hexdig = "0123456789abcdef"; |
787 |
static char *hexdig = "0123456789abcdef"; |
788 |
|
788 |
|
789 |
static char *ars_decode_hex(struct ars_packet *pkt, char *s, int *blen) |
789 |
static unsigned char *ars_decode_hex(struct ars_packet *pkt, char *s, int *blen) |
790 |
{ |
790 |
{ |
791 |
int len = strlen(s), i; |
791 |
int len = strlen(s), i; |
792 |
unsigned char *d, *saved; |
792 |
unsigned char *d, *saved; |
Lines 823-829
Link Here
|
823 |
return saved; |
823 |
return saved; |
824 |
} |
824 |
} |
825 |
|
825 |
|
826 |
static char *ars_decode_string(struct ars_packet *pkt, char *s, int *blen) |
826 |
static unsigned char *ars_decode_string(struct ars_packet *pkt, char *s, int *blen) |
827 |
{ |
827 |
{ |
828 |
int l = strlen(s), i; |
828 |
int l = strlen(s), i; |
829 |
int bl = 0; |
829 |
int bl = 0; |
Lines 875-881
Link Here
|
875 |
return -ARS_OK; |
875 |
return -ARS_OK; |
876 |
return ars_push_data(pkt, layer, buffer, n_read); |
876 |
return ars_push_data(pkt, layer, buffer, n_read); |
877 |
} else if (strcasecmp(f, "str") == 0) { |
877 |
} else if (strcasecmp(f, "str") == 0) { |
878 |
char *binary; |
878 |
unsigned char *binary; |
879 |
int err, blen; |
879 |
int err, blen; |
880 |
|
880 |
|
881 |
binary = ars_decode_string(pkt, v, &blen); |
881 |
binary = ars_decode_string(pkt, v, &blen); |
Lines 885-891
Link Here
|
885 |
free(binary); |
885 |
free(binary); |
886 |
return err; |
886 |
return err; |
887 |
} else if (strcasecmp(f, "hex") == 0) { |
887 |
} else if (strcasecmp(f, "hex") == 0) { |
888 |
char *binary; |
888 |
unsigned char *binary; |
889 |
int err, blen; |
889 |
int err, blen; |
890 |
|
890 |
|
891 |
binary = ars_decode_hex(pkt, v, &blen); |
891 |
binary = ars_decode_hex(pkt, v, &blen); |