Well, it was correct code, as it was working, and after a macOS update, the code that used to be correct, is no longer correct. But it's not the fault of macOS, but the people who produced the code?
I haven’t checked this case, but that’s not valid logic in general. For example, code that writes out of bounds data can be ‘working’, yet read from or write to unallocated memory, but then break when a new OS release changes the memory allocator or changes the size of some allocations.
Another example are broken checks for features. If, instead of checking whether the OS or CPU supports feature ‘foo’, you check for ‘version ≥ magic_number’, assuming every OS/CPU will after that will support the feature, your program code can stop working when that assumption turns out to be incorrect.
The code was broken all the time, though.
I guess I'd reserve "broken code" for code that doesn't work at all, I wouldn't use it to describe code that worked in one environment but not in another, unless purposefully built for the second of course.
If you write out of bounds or occasionally read memory you didn’t allocate and how do you know you get away with it, so that you can declare the code “correct”? Your program may crash only once in a thousand years.
In my book it still would be incorrect as soon as it breaks the interface contract of the API, even if it never crashed or misbehaved.
Also, in your definition, you can’t complain if a program stops running after even a tiny OS upgrade it wasn’t “purposely built for”, for example because it that didn’t exist yet at the time the program was compiled.
Hell, I could write code which "happens to work" because I use the OS's version number as the length of an array and the OS's version number happens to be the same as the number of items in the array.
OTOH if you make an OS and you break API contracts that you had in the past, that would reasonably be expected to continue working, it's your fault.
Blame is a judgement call.
Oracle was relying on behaviour that was POSIX valid so I don't see how it is "incorrect code".
Some say it's a POSIX valid thing to do.