Changeset 91042 in vbox
- Timestamp:
- Aug 31, 2021 6:34:40 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTestServiceClient.cpp
r91040 r91042 165 165 else if (RTStrNCmp(Reply.szOp, "FAILED ", ATSPKT_OPCODE_MAX_LEN) == 0) 166 166 { 167 LogRelFunc(("Received error from server (cbPayload=%zu)\n", Reply.cbPayload)); 168 167 169 if (Reply.cbPayload) 168 170 { 169 if (Reply.cbPayload == sizeof(ATSPKTREPFAIL)) 171 if ( Reply.cbPayload >= sizeof(int) /* At least the rc must be present. */ 172 && Reply.cbPayload <= sizeof(ATSPKTREPFAIL) - sizeof(ATSPKTHDR)) 170 173 { 171 PATSPKTREPFAIL pRep = (PATSPKTREPFAIL)Reply.pvPayload; 174 rc = *(int *)Reply.pvPayload; /* Reach error code back to caller. */ 175 176 const char *pcszMsg = (char *)Reply.pvPayload + sizeof(int); 172 177 /** @todo Check NULL termination of pcszMsg? */ 173 178 174 LogRelFunc(("Received error: %s (%Rrc)\n", pRep->ach, pRep->rc)); 175 176 rc = pRep->rc; /* Reach error code back to caller. */ 179 LogRelFunc(("Error message: %s (%Rrc)\n", pcszMsg, rc)); 177 180 } 178 181 else … … 192 195 } 193 196 197 LogRelFlowFuncLeaveRC(rc); 194 198 return rc; 195 199 }
Note:
See TracChangeset
for help on using the changeset viewer.