Commit 275f103
committed
odb: reject reading and writing null OIDs
The null OID (hash with all zeroes) indicates a missing object in
upstream git and is thus not a valid object ID. Add defensive
measurements to avoid writing such a hash to the object database in the
very unlikely case where some data results in the null OID. Furthermore,
add shortcuts when reading the null OID from the ODB to avoid ever
returning an object when a faulty repository may contain the null OID.1 parent c0487bd commit 275f103
2 files changed
+43
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
735 | 736 | | |
736 | 737 | | |
737 | 738 | | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
738 | 742 | | |
739 | 743 | | |
740 | 744 | | |
| |||
958 | 962 | | |
959 | 963 | | |
960 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
961 | 970 | | |
962 | 971 | | |
963 | 972 | | |
964 | 973 | | |
965 | 974 | | |
966 | 975 | | |
967 | 976 | | |
968 | | - | |
969 | 977 | | |
970 | 978 | | |
971 | 979 | | |
| |||
1057 | 1065 | | |
1058 | 1066 | | |
1059 | 1067 | | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1060 | 1071 | | |
1061 | 1072 | | |
1062 | 1073 | | |
| |||
1078 | 1089 | | |
1079 | 1090 | | |
1080 | 1091 | | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1081 | 1095 | | |
1082 | 1096 | | |
1083 | 1097 | | |
| |||
1231 | 1245 | | |
1232 | 1246 | | |
1233 | 1247 | | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1234 | 1252 | | |
1235 | 1253 | | |
1236 | 1254 | | |
| |||
1484 | 1502 | | |
1485 | 1503 | | |
1486 | 1504 | | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
1487 | 1511 | | |
1488 | 1512 | | |
1489 | 1513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
0 commit comments