(/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_sync.c) |
| |
| 1154 | | | sync_pipe_input_cb(gint source, gpointer user_data) |
| 1155 | | | { |
| 1156 | | | capture_options *capture_opts = (capture_options *)user_data; |
| 1157 | | | char buffer[SP_MAX_MSG_LEN+1]; |
| 1158 | | | int nread; |
| 1159 | | | char indicator; |
| 1160 | | | int primary_len; |
| 1161 | | | char * primary_msg; |
| 1162 | | | int secondary_len; |
| 1163 | | | char * secondary_msg; |
| 1164 | | | |
| 1165 | | | |
| 1166 | [+] | | nread = pipe_read_block(source, &indicator, SP_MAX_MSG_LEN, buffer); |
Event 1:
pipe_read_block() does not initialize buffer. - This may be because of a failure case or other special case for pipe_read_block().
hide
|
|
 |
| 1167 | | | if(nread <= 0) { |
Event 9:
Skipping " if". nread <= 0 evaluates to false.
hide
|
|
| 1168 | | | if (nread == 0) |
| 1169 | | | g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, |
| 1170 | | | "sync_pipe_input_cb: child has closed sync_pipe"); |
| 1171 | | | else |
| 1172 | | | g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, |
| 1173 | | | "sync_pipe_input_cb: error reading from sync pipe"); |
| 1174 | | | |
| 1175 | | | |
| 1176 | | | |
| 1177 | | | |
| 1178 | | | |
| 1179 | | | |
| 1180 | | | |
| 1181 | | | |
| 1182 | | | |
| 1183 | | | |
| 1184 | | | sync_pipe_wait_for_child(capture_opts); |
| 1185 | | | |
| 1186 | | | #ifdef _WIN32 |
| 1187 | | | ws_close(capture_opts->signal_pipe_write_fd); |
| 1188 | | | #endif |
| 1189 | | | capture_input_closed(capture_opts); |
| 1190 | | | return FALSE; |
| 1191 | | | } |
| 1192 | | | |
| 1193 | | | |
| 1194 | | | switch(indicator) { |
Event 10:
indicator evaluates to 80.
hide
|
|
| 1195 | | | case SP_FILE:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/sync_pipe.h |
| |
53 | #define SP_FILE 'F' /* the name of the recently opened file */ |
| |
|
| 1196 | | | if(!capture_input_new_file(capture_opts, buffer)) { |
| 1197 | | | g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "sync_pipe_input_cb: file failed, closing capture"); |
| 1198 | | | |
| 1199 | | | |
| 1200 | | | |
| 1201 | | | ws_close(source); |
| 1202 | | | |
| 1203 | | | |
| 1204 | | | |
| 1205 | | | |
| 1206 | | | |
| 1207 | | | |
| 1208 | | | sync_pipe_stop(capture_opts); |
| 1209 | | | } |
| 1210 | | | break; |
| 1211 | | | case SP_PACKET_COUNT:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/sync_pipe.h |
| |
56 | #define SP_PACKET_COUNT 'P' /* count of packets captured since last message */ |
| |
|
| 1212 | | | nread = atoi(buffer); |
Event 11:
buffer is passed to atoi().
hide
Uninitialized Variable
*buffer was not initialized, but is used inside atoi(). The issue can occur if the highlighted code executes. See related events 1 and 11. Show: All events | Only primary events |
|
| |