Why are these examples of dangerous code?

Example I

  1. function example_one($nid) {
  2.   // Lots of code
  3.   $node = node_load($nid);  
  4.   // ...
  5.   $user = user_load(array('uid' => $node->uid));
  6. }

Example II

  1. function example_two($account) {
  2.   // ...
  3.   $account = user_load(array('uid' => $uid));
  4. }