View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001666 | libmicrohttpd | build system | public | 2011-03-03 14:03 | 2011-03-04 10:57 |
| Reporter | tmayer | Assigned To | Christian Grothoff | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 0.9.7 | ||||
| Summary | 0001666: Base64 decode fails when char is defined as unsigned char | ||||
| Description | I compile our application with angstrom-gcc for ARM. There char is defined as unsigned char. Base64.c uses -1 to indicate the end of the encoded string. Because it is unsigned char the -1 contained in base64_digits is going to be converted to 255. This breaks the later compare. | ||||
| Tags | No tags attached. | ||||
| Attached Files | base64-arm-unsigned-char.patch (780 bytes)
*** base64.c.0.9.7 2011-01-20 11:56:45.000000000 +0100 --- base64.c 2011-03-03 13:23:51.566784529 +0100 *************** *** 46,55 **** char c = base64_digits[(unsigned char)*(src++)]; char d = base64_digits[(unsigned char)*(src++)]; *(dest++) = (a << 2) | ((b & 0x30) >> 4); ! if (c == -1) break; *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); ! if (d == -1) break; *(dest++) = ((c & 0x03) << 6) | d; } --- 46,55 ---- char c = base64_digits[(unsigned char)*(src++)]; char d = base64_digits[(unsigned char)*(src++)]; *(dest++) = (a << 2) | ((b & 0x30) >> 4); ! if (c == (char)-1) break; *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); ! if (d == (char)-1) break; *(dest++) = ((c & 0x03) << 6) | d; } | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-03-03 14:03 | tmayer | New Issue | |
| 2011-03-03 14:03 | tmayer | File Added: base64-arm-unsigned-char.patch | |
| 2011-03-03 14:05 | tmayer | Note Added: 0004280 | |
| 2011-03-03 21:45 | Christian Grothoff | Note Added: 0004281 | |
| 2011-03-03 21:45 | Christian Grothoff | Status | new => resolved |
| 2011-03-03 21:45 | Christian Grothoff | Resolution | open => fixed |
| 2011-03-03 21:45 | Christian Grothoff | Assigned To | => Christian Grothoff |
| 2011-03-04 10:57 | Christian Grothoff | Status | resolved => closed |