mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-19 03:06:28 +00:00
Found and fixed evil memory corruption error.
This commit is contained in:
parent
ba645687f6
commit
e069984c71
@ -1455,6 +1455,7 @@ int overlay_rhizome_add_advertisements(int interface_number,overlay_buffer *e)
|
|||||||
WHY("Couldn't open blob");
|
WHY("Couldn't open blob");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
ob_makespace(e,RHIZOME_BAR_BYTES);
|
||||||
if (sqlite3_blob_read(blob,&e->bytes[e->length],RHIZOME_BAR_BYTES,0)
|
if (sqlite3_blob_read(blob,&e->bytes[e->length],RHIZOME_BAR_BYTES,0)
|
||||||
!=SQLITE_OK) {
|
!=SQLITE_OK) {
|
||||||
WHY("Couldn't read from blob");
|
WHY("Couldn't read from blob");
|
||||||
@ -1462,12 +1463,15 @@ int overlay_rhizome_add_advertisements(int interface_number,overlay_buffer *e)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
e->length+=RHIZOME_BAR_BYTES;
|
e->length+=RHIZOME_BAR_BYTES;
|
||||||
|
slots_used++;
|
||||||
|
|
||||||
sqlite3_blob_close(blob);
|
sqlite3_blob_close(blob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug>1) printf("Appended %d rhizome advertisements to packet.\n",slots_used);
|
||||||
e->bytes[rfs_offset]=1+1+1+8*slots_used;
|
e->bytes[rfs_offset]=1+1+1+8*slots_used;
|
||||||
|
sqlite3_finalize(statement);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user