▲ 77 ▼ MongoBleed explained simply | MongoDB exploit (bigdata.2minutestreaming.com) submitted 10 months ago by qaz@lemmy.world to c/technology@lemmy.world 11 comments fedilink hide all child comments cross-posted from: https://lemmy.world/post/40839222 Simple example
[–] rothaine@lemmy.zip 2 points 10 months ago (3 children) TLDR use calloc instead of malloc permalink fedilink source hideshow 3 child comments replies: [–] qaz@lemmy.world [S] 1 point 10 months ago (2 children) Doesn't that make it slower because it needs to zero out all the bytes first? permalink fedilink source parent hideshow 2 child comments replies: [–] rothaine@lemmy.zip 2 points 10 months ago (1 child) My understanding is that it's only slightly slower: the OS maintains a pool of zeroed pages anyway, so it's not like your program has to iterate over all the addresses and write to them. But it's been a long time since I've done any C/C++ so I could be wrong. permalink fedilink source parent hideshow 1 child comment replies: [–] qaz@lemmy.world [S] 2 points 10 months ago the OS maintains a pool of zeroed pages TIL, I didn't know that. permalink fedilink source parent
[–] qaz@lemmy.world [S] 1 point 10 months ago (2 children) Doesn't that make it slower because it needs to zero out all the bytes first? permalink fedilink source parent hideshow 2 child comments replies: [–] rothaine@lemmy.zip 2 points 10 months ago (1 child) My understanding is that it's only slightly slower: the OS maintains a pool of zeroed pages anyway, so it's not like your program has to iterate over all the addresses and write to them. But it's been a long time since I've done any C/C++ so I could be wrong. permalink fedilink source parent hideshow 1 child comment replies: [–] qaz@lemmy.world [S] 2 points 10 months ago the OS maintains a pool of zeroed pages TIL, I didn't know that. permalink fedilink source parent
[–] rothaine@lemmy.zip 2 points 10 months ago (1 child) My understanding is that it's only slightly slower: the OS maintains a pool of zeroed pages anyway, so it's not like your program has to iterate over all the addresses and write to them. But it's been a long time since I've done any C/C++ so I could be wrong. permalink fedilink source parent hideshow 1 child comment replies: [–] qaz@lemmy.world [S] 2 points 10 months ago the OS maintains a pool of zeroed pages TIL, I didn't know that. permalink fedilink source parent
[–] qaz@lemmy.world [S] 2 points 10 months ago the OS maintains a pool of zeroed pages TIL, I didn't know that. permalink fedilink source parent