Skip to content

Commit

Permalink
Bail out if we do not have a meaningful amount of data in the packet …
Browse files Browse the repository at this point in the history
…to work with.
  • Loading branch information
jwise committed Nov 17, 2014
1 parent a4cabdf commit e6efe07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HoRNDIS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<key>CFBundleIdentifier</key>
<string>com.joshuawise.kexts.HoRNDIS</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<string>7.1</string>

This comment has been minimized.

This comment has been minimized.

Copy link
@jwise

jwise Nov 18, 2014

Author Owner

Fixed. Thanks!

<key>CFBundleName</key>
<string>HoRNDIS</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>6</string>
<string>7.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
5 changes: 5 additions & 0 deletions HoRNDIS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,11 @@ void HoRNDIS::receivePacket(void *packet, UInt32 size) {
struct rndis_data_hdr *hdr = (struct rndis_data_hdr *)packet;
uint32_t msg_len, data_ofs, data_len;

if (size <= sizeof(struct rndis_data_hdr)) {
LOG(V_ERROR, "receivePacket() on too small packet? (size %d)", size);
return;
}

msg_len = le32_to_cpu(hdr->msg_len);
data_ofs = le32_to_cpu(hdr->data_offset);
data_len = le32_to_cpu(hdr->data_len);
Expand Down

0 comments on commit e6efe07

Please sign in to comment.