{"id":391,"date":"2004-07-09T18:48:58","date_gmt":"2004-07-09T16:48:58","guid":{"rendered":"http:\/\/vasil.ludost.net\/blog\/?p=391"},"modified":"2004-07-09T18:48:58","modified_gmt":"2004-07-09T16:48:58","slug":"2004-07-09-1848","status":"publish","type":"post","link":"https:\/\/vasil.ludost.net\/blog\/?p=391","title":{"rendered":"2004-07-09 18:48"},"content":{"rendered":"<p>Some moments ago I fought with a stupid mistake&#8230; How haven&#8217;t I fixed that before, I have no idea.<\/p>\n<p>It was in qmail with a patch for mysql support. The problem was in this line:<\/p>\n<pre>pw = (struct passwd *) malloc(sizeof(struct passwd *));<\/pre>\n<p>And of course, malloc does what we tell him, not what we want, and allocates 4 bytes. After that the program starts accessing the structure&#8217;s fields and BOOM&#8230;<br \/>\nI should mention, that if I hadn&#8217;t used indent to fix the source, to be able to see what does it do (2 spaces tabulation DOESN&#8217;T WORK, Bernstein!), I would be probably still banging my head&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some moments ago I fought with a stupid mistake&#8230; How haven&#8217;t I fixed that before, I have no idea. It was in qmail with a patch for mysql support. The problem was in this line: pw = (struct passwd *) malloc(sizeof(struct passwd *)); And of course, malloc does what we tell him, not what we [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-391","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=391"}],"version-history":[{"count":0,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions"}],"wp:attachment":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}