<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -772,8 +772,13 @@ bloops_track_str(bloopsatrack *track)
   for (i = 0; i &lt; track-&gt;nlen; i++)
   {
     if (ptr - str + adv + sizeof(char) * 256 &gt; bufsize) {
+      char *new_str;
       bufsize += sizeof(char) * 1024;
-      realloc(str, bufsize);
+      new_str = realloc(str, bufsize);
+      if (new_str == NULL) {
+        free(str);
+        return NULL;
+      }
     }
 
     if (ptr &gt; str)
@@ -960,7 +965,7 @@ bloops_note_freq(char note, int octave)
 #define KEY(name) key = (void *)&amp;P-&gt;name
 
 
-#line 964 &quot;c/notation.c&quot;
+#line 969 &quot;c/notation.c&quot;
 static const char _bloopserial_actions[] = {
 	0, 1, 0, 1, 1, 1, 2, 1, 
 	5, 1, 6, 1, 7, 1, 8, 1, 
@@ -1267,7 +1272,7 @@ static const int bloopserial_error = 0;
 
 static const int bloopserial_en_main = 142;
 
-#line 435 &quot;c/notation.rl&quot;
+#line 440 &quot;c/notation.rl&quot;
 
 
 bloopsaphone *
@@ -1299,16 +1304,16 @@ bloops_sound_file(bloops *B, char *fname)
 
   P = bloops_square();
   
-#line 1303 &quot;c/notation.c&quot;
+#line 1308 &quot;c/notation.c&quot;
 	{
 	cs = bloopserial_start;
 	ts = 0;
 	te = 0;
 	act = 0;
 	}
-#line 466 &quot;c/notation.rl&quot;
+#line 471 &quot;c/notation.rl&quot;
   
-#line 1312 &quot;c/notation.c&quot;
+#line 1317 &quot;c/notation.c&quot;
 	{
 	int _klen;
 	unsigned int _trans;
@@ -1329,7 +1334,7 @@ _resume:
 #line 1 &quot;c/notation.rl&quot;
 	{ts = p;}
 	break;
-#line 1333 &quot;c/notation.c&quot;
+#line 1338 &quot;c/notation.c&quot;
 		}
 	}
 
@@ -1395,150 +1400,150 @@ _eof_trans:
 		switch ( *_acts++ )
 		{
 	case 0:
-#line 389 &quot;c/notation.rl&quot;
+#line 394 &quot;c/notation.rl&quot;
 	{
     fval = ATOI(ts, p - ts) * 1.0f;
   }
 	break;
 	case 1:
-#line 393 &quot;c/notation.rl&quot;
+#line 398 &quot;c/notation.rl&quot;
 	{
     fval = ATOI(pf, p - pf) * pow(0.1f, p - pf);
   }
 	break;
 	case 2:
-#line 397 &quot;c/notation.rl&quot;
+#line 402 &quot;c/notation.rl&quot;
 	{ pf = p; }
 	break;
 	case 3:
-#line 398 &quot;c/notation.rl&quot;
+#line 403 &quot;c/notation.rl&quot;
 	{ fval *= -1.0f; }
 	break;
 	case 4:
-#line 399 &quot;c/notation.rl&quot;
+#line 404 &quot;c/notation.rl&quot;
 	{ KEY(volume); }
 	break;
 	case 5:
-#line 400 &quot;c/notation.rl&quot;
+#line 405 &quot;c/notation.rl&quot;
 	{ KEY(arp); }
 	break;
 	case 6:
-#line 401 &quot;c/notation.rl&quot;
+#line 406 &quot;c/notation.rl&quot;
 	{ KEY(aspeed); }
 	break;
 	case 7:
-#line 402 &quot;c/notation.rl&quot;
+#line 407 &quot;c/notation.rl&quot;
 	{ KEY(attack); }
 	break;
 	case 8:
-#line 403 &quot;c/notation.rl&quot;
+#line 408 &quot;c/notation.rl&quot;
 	{ KEY(decay); }
 	break;
 	case 9:
-#line 404 &quot;c/notation.rl&quot;
+#line 409 &quot;c/notation.rl&quot;
 	{ KEY(dslide); }
 	break;
 	case 10:
-#line 405 &quot;c/notation.rl&quot;
+#line 410 &quot;c/notation.rl&quot;
 	{ KEY(freq); }
 	break;
 	case 11:
-#line 406 &quot;c/notation.rl&quot;
+#line 411 &quot;c/notation.rl&quot;
 	{ KEY(hpf); }
 	break;
 	case 12:
-#line 407 &quot;c/notation.rl&quot;
+#line 412 &quot;c/notation.rl&quot;
 	{ KEY(hsweep); }
 	break;
 	case 13:
-#line 408 &quot;c/notation.rl&quot;
+#line 413 &quot;c/notation.rl&quot;
 	{ KEY(limit); }
 	break;
 	case 14:
-#line 409 &quot;c/notation.rl&quot;
+#line 414 &quot;c/notation.rl&quot;
 	{ KEY(lpf); }
 	break;
 	case 15:
-#line 410 &quot;c/notation.rl&quot;
+#line 415 &quot;c/notation.rl&quot;
 	{ KEY(lsweep); }
 	break;
 	case 16:
-#line 411 &quot;c/notation.rl&quot;
+#line 416 &quot;c/notation.rl&quot;
 	{ KEY(phase); }
 	break;
 	case 17:
-#line 412 &quot;c/notation.rl&quot;
+#line 417 &quot;c/notation.rl&quot;
 	{ KEY(psweep); }
 	break;
 	case 18:
-#line 413 &quot;c/notation.rl&quot;
+#line 418 &quot;c/notation.rl&quot;
 	{ KEY(repeat); }
 	break;
 	case 19:
-#line 414 &quot;c/notation.rl&quot;
+#line 419 &quot;c/notation.rl&quot;
 	{ KEY(resonance); }
 	break;
 	case 20:
-#line 415 &quot;c/notation.rl&quot;
+#line 420 &quot;c/notation.rl&quot;
 	{ KEY(slide); }
 	break;
 	case 21:
-#line 416 &quot;c/notation.rl&quot;
+#line 421 &quot;c/notation.rl&quot;
 	{ KEY(square); }
 	break;
 	case 22:
-#line 417 &quot;c/notation.rl&quot;
+#line 422 &quot;c/notation.rl&quot;
 	{ KEY(sustain); }
 	break;
 	case 23:
-#line 418 &quot;c/notation.rl&quot;
+#line 423 &quot;c/notation.rl&quot;
 	{ KEY(sweep); }
 	break;
 	case 24:
-#line 419 &quot;c/notation.rl&quot;
+#line 424 &quot;c/notation.rl&quot;
 	{ KEY(punch); }
 	break;
 	case 25:
-#line 420 &quot;c/notation.rl&quot;
+#line 425 &quot;c/notation.rl&quot;
 	{ KEY(vibe); }
 	break;
 	case 26:
-#line 421 &quot;c/notation.rl&quot;
+#line 426 &quot;c/notation.rl&quot;
 	{ KEY(vspeed); }
 	break;
 	case 27:
-#line 422 &quot;c/notation.rl&quot;
+#line 427 &quot;c/notation.rl&quot;
 	{ KEY(vdelay); }
 	break;
 	case 28:
-#line 423 &quot;c/notation.rl&quot;
+#line 428 &quot;c/notation.rl&quot;
 	{ KEY(volume); }
 	break;
 	case 31:
-#line 427 &quot;c/notation.rl&quot;
+#line 432 &quot;c/notation.rl&quot;
 	{te = p+1;{ P-&gt;type = BLOOPS_SQUARE; }}
 	break;
 	case 32:
-#line 428 &quot;c/notation.rl&quot;
+#line 433 &quot;c/notation.rl&quot;
 	{te = p+1;{ P-&gt;type = BLOOPS_SAWTOOTH; }}
 	break;
 	case 33:
-#line 429 &quot;c/notation.rl&quot;
+#line 434 &quot;c/notation.rl&quot;
 	{te = p+1;{ P-&gt;type = BLOOPS_SINE; }}
 	break;
 	case 34:
-#line 430 &quot;c/notation.rl&quot;
+#line 435 &quot;c/notation.rl&quot;
 	{te = p+1;{ P-&gt;type = BLOOPS_NOISE; }}
 	break;
 	case 35:
-#line 426 &quot;c/notation.rl&quot;
+#line 431 &quot;c/notation.rl&quot;
 	{te = p;p--;{ *((float *)key) = fval; }}
 	break;
 	case 36:
-#line 431 &quot;c/notation.rl&quot;
+#line 436 &quot;c/notation.rl&quot;
 	{te = p;p--;}
 	break;
-#line 1542 &quot;c/notation.c&quot;
+#line 1547 &quot;c/notation.c&quot;
 		}
 	}
 
@@ -1551,7 +1556,7 @@ _again:
 #line 1 &quot;c/notation.rl&quot;
 	{ts = 0;}
 	break;
-#line 1555 &quot;c/notation.c&quot;
+#line 1560 &quot;c/notation.c&quot;
 		}
 	}
 
@@ -1570,7 +1575,7 @@ _again:
 
 	_out: {}
 	}
-#line 467 &quot;c/notation.rl&quot;
+#line 472 &quot;c/notation.rl&quot;
 
 done:
   fclose(fp);</diff>
      <filename>c/notation.c</filename>
    </modified>
    <modified>
      <diff>@@ -192,8 +192,13 @@ bloops_track_str(bloopsatrack *track)
   for (i = 0; i &lt; track-&gt;nlen; i++)
   {
     if (ptr - str + adv + sizeof(char) * 256 &gt; bufsize) {
+      char *new_str;
       bufsize += sizeof(char) * 1024;
-      realloc(str, bufsize);
+      new_str = realloc(str, bufsize);
+      if (new_str == NULL) {
+        free(str);
+        return NULL;
+      }
     }
 
     if (ptr &gt; str)</diff>
      <filename>c/notation.rl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>68b0b4ab47f7c3edd977aa3aff49031d91d69bca</id>
    </parent>
  </parents>
  <author>
    <name>MenTaLguY</name>
    <email>mental@rydia.net</email>
  </author>
  <url>http://github.com/localhost/bloopsaphone/commit/e579e2d1a493c6f98c32f983703edda86d4a9483</url>
  <id>e579e2d1a493c6f98c32f983703edda86d4a9483</id>
  <committed-date>2009-07-30T18:51:59-07:00</committed-date>
  <authored-date>2009-06-26T22:39:54-07:00</authored-date>
  <message>address heap corruption in notation

Signed-off-by: why the lucky stiff &lt;why@whytheluckystiff.net&gt;</message>
  <tree>8ba42cbf4d736ddf5cff20e43d93ef71a6ef4dc0</tree>
  <committer>
    <name>Alex Brem</name>
    <email>alex@fluktuation.net</email>
  </committer>
</commit>
