Would
dd if=/dev/zero of=somepartition bs=512
also wipe partitions after somepartition or stop at the end of somepartition?
Would
dd if=/dev/zero of=somepartition bs=512
also wipe partitions after somepartition or stop at the end of somepartition?
dddd is a very powerful but also dangerous tool. It does what you tell it to do without questions. So if you tell it to wipe the family pictures, ... and it is a minor typing error away.
But if you check and double-check, you can use it.
dd if=/dev/zero of=somepartition bs=512
or I would suggest
dd if=/dev/zero of=/dev/sdxn bs=4096
where x is the drive letter and n is the partition number and block size 4096 bytes makes the write process faster.
It is important that you write to a partition in this case. If you write to the whole drive (the drive head end) /dev/sdx the whole drive will be overwritten. But writing to the partition will be interrupted at the end of the partition and partitions behind it will be preserved. (I tested now on a USB pendrive in Lubuntu 16.04 LTS, so I know that it works like that.)
There is an exception for an extended partition (which is a container for logical partitions, in order to have more than four partitions in an MSDOS partition table). This is described in the following link,
Can I make image of 'extended' partition using dd?
But there is another problem too. I tested your command in a test environment, and dd read only one kibibyte (1024 bytes) when I wanted it to make an image of an extended partition.
I tested also this now on a USB pendrive in Lubuntu 16.04 LTS, and this applies to writing (as well as to reading). Only the first kibibyte is overwritten.
So to summarize, overwriting primary partitions and logical partitions work according to the main description in this answer. But do not use this method to overwrite an extended partition because only the first kibibyte will be overwritten. The extended partition's logical partitions will no longer be found via the partition table, but the data stored in them are still there.
I think your question is based on a fundamental misunderstanding about how dd (and in fact Unix-like operating systems in general) work:
dd cannot overwrite adjacent partitions, simply because dd cannot overwrite partitions, period.
dd simply writes to files. That's it.
Now, if you pass dd a file which represents multiple partitions, then dd will overwrite that file. But in that case, it's not dd writing past the end of the partition. dd will still write until the end of the file, and only until the end of the file.
But, if you pass dd a file which only represents one partition, then dd will not write past the end of this partition. Again, this has nothing to do with dd. dd simply writes to the file you tell it to write to. The fact that this file represents a single partition is (in this case) ensured by the block device driver in the kernel. dd has nothing to do with that.
So, in short: dd writes to files. What those files represent, is none of dd's concern. dd knows nothing about partitions.
Writes to a partition device won't write outside of that partition, with dd or anything else. You would need to use a wholedisk device to have any effect outside of a single partition.
(Caveat: unless your disk has a partition table with overlapping partitions, which should never happen.)
There is a dangerous, but rare special scenario in which this could happen even with non-buggy block device drivers:
You have to be careful with dd as if you make a mistake you can overwrite more than you bargained for and it depends on what you are using dd for (the OP was vague in his or her use of dd and the exact syntax of the dd command).
If you specify a partition it will write to that partition until the partition is full.
If you make a mistake and put the entire drive, for example of=/dev/sda , dd will write to the entire drive start to finish ignoring (and overwriting) your partition table.
You can also us dd on a partition to overwrite deleted files (deleted files may remain on the partition and discovered by various recovery tools with various degrees of success until they are over written. In this case you can use dd to fill the free space by writing to a file.
dd if=/dev/zero of=/path/to/mount_point/zero_file bs=4096
rm -f /path/to/mount_point/zero_file
Depending on what you are doing, however, you may wish to use an alternate tool to securely delete files. See How to delete file(s) in secure manner? for options.